java.util APIs
Composite Recipes
Recipes that include further recipes, often including the individual recipes below.
Recipes
- Prefer
EnumSet of(..)
- Prefer
List.of(..)
- Prefer
List.of(..)
- Prefer
Locale.of(..)
overnew Locale(..)
- Prefer
Map.of(..)
- Prefer
Map.of(..)
- Prefer
Optional.isEmpty()
- Prefer
Optional.isPresent()
- Prefer
Set.of(..)
- Prefer
Set.of(..)
- Remove invocations of deprecated invocations from Deflater, Inflater, ZipFile
- Replace
List.get(int)
,add(int, Object)
, andremove(int)
withSequencedCollection
*First
and*Last
methods - Replace
Stream.collect(Collectors.toUnmodifiableList())
withStream.toList()
- Replace
iterator().next()
withgetFirst()
- Replace
java.lang.Math random()
withThreadLocalRandom nextDouble()
Stream<Optional>
idiom recipe- Use
getFirst()
instead ofstream().findFirst().orElseThrow()