Compare two different objects in different lists in Java

I need to check if an object present in list A exists in list B without using nested for loops because if the lists have a large size, it takes too much time.

This is my code :

for(Person el : persons)
{
    for(Client in : clients)
    {
        if(el.getIdentifier() == in.getTire().getIdentifier())
        {
            exists=true;
            break;
        }
    }
}

How can i achieve the same result without using loops and break?

Answer

This will change the complexity of your code from O(NxM) to O(N+M):

    Set<Integer> personIds = persons.stream()
            .map(e -> e.getIdentifier())
            .collect(Collectors.toCollection(HashSet::new));

    boolean exists = clients.stream().anyMatch(
            c -> personIds.contains(c.getTire().getIdentifier()));