I have this method that checks the username and password of a user before login. Now my for loop checks only the first item, it finds that the first condition, u.getRole()
u.getRole()
You use a break statement within the loop. This causes the loop to exit.
break