Application of @Sneaky Throws in lombok
To add to the existing answers. I personally dislike checked exceptions. See for more info: https://phauer.com/2015/checked-exceptions-are-evil/ To add insult to injury, the code gets bloated when avoiding the checked exceptions. Consider the usage of @SneakyThrows: List<Instant> instantsSneaky = List.of(“2020-09-28T12:30:08.797481Z”) .stream() .map(Example::parseSneaky) .collect(Collectors.toList()); @SneakyThrows private static Instant parseSneaky(String queryValue) { return new SimpleDateFormat(“yyyy-MM-dd’T’HH:mm:ss.SSS’Z'”).parse(queryValue).toInstant(); } versus non-@SneakyThrows … Read more