Код: Выделить всё
final String stringToBeMatched = "someRandomString";
map.values()
.stream()
.filter(a -> stringToBeMatched == a.getField())
.findAny()
.ifPresent(a -> throw new IllegalArgumentException());
Подробнее здесь: https://stackoverflow.com/questions/368 ... atch-found
Мобильная версия