79291050

Date: 2024-12-18 12:20:17
Score: 0.5
Natty:
Report link

You could do a peek and throw exception:

map.values()
    .stream()
    .peek(a -> {
        if (stringToBeMatched == a.getField()) {
            throw new RuntimeException("Expecting field to match: " + stringToBeMatched);
        }
    });
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: alex-jesper