@XmlElement(name = "Emp", type = UserBean.class)
        @XmlElementWrapper(name = "Emps")
        private List<UserBean> users;       
 if (users.stream().anyMatch(x -> x.getUsername().equals(userBean.getUsername()))
                    && users.stream().anyMatch(x -> x.getPassowrd().equals(userBean.getPassowrd()))) {
                login=true;
    }
This function checks whether a password and name exist in a container. I fill the container from xml file. However, that only check that items are existing, not the matching.
xml:
        <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <Department>
        <Emps>
            <Emp>
                <username>Name</username>
                <password>name</password>
            </Emp>
            <Emp>
                <username>Name2</username>
                <password>name2</password>
            </Emp>
    </Emps>
</Department>
So I can enter username Name and the password name2 and login still will be true. Are they any ways to set login to true only if username and password are matching?
 
    