"A"::startsWith is a reference to a method that can be assigned to Predicate<String> , and when this Predicate<String> tested on some other String , it checks if the string St24 "A" begins with this other String >, and not vice versa.
list.removeIf(TTT) will not delete anything from list , since "A" does not start with either "Mage" or "Helper".
Instead, you can use the lambda expression:
Predicate<String> TTT = s -> s.startsWith("A");
The only way your source predicate "A"::startsWith removed anything from the list is with the list containing String "A" or an empty String .
source share