Take this Lambda:
final List<String> badKeys = pivMap.entrySet().stream()
.filter(entry -> StringUtils.trimToNull(entry.getValue()) == null || entry.getValue().equals("{}") || entry.getValue().equals("{ }"))
.map(Map.Entry::getKey)
.collect(Collectors.toList());
We want to make sure there's an explicit type on the Lambda variable:
final List<String> badKeys = pivMap.entrySet().stream()
.filter((final Map.Entry<String, String> entry) -> StringUtils.trimToNull(entry.getValue()) == null || entry.getValue().equals("{}") || entry.getValue().equals("{ }"))
.map(Map.Entry::getKey)
.collect(Collectors.toList());
Is there a way to use puppycrawl checkstyle to check there's a type on the lambda expression above? In this case the type declaration on the variable is: (final Map.Entry<String, String> entry)