Bi-Arity:Two Arguments Without a Pair Type
Use BiFunction, BiPredicate, and BiConsumer for two-argument slots — apply, test, accept — and fill Map.merge, compute, and forEach without inventing a pair type.
Read MoreBrowse the full archive. Use topics in the sidebar to explore by tag.
Use BiFunction, BiPredicate, and BiConsumer for two-argument slots — apply, test, accept — and fill Map.merge, compute, and forEach without inventing a pair type.
Read MoreHands-on grep recipes for everyday work — find text, filter logs, search codebases, and pipe results with confidence.
Read MoreUse UnaryOperator and BinaryOperator when input and output are the same type — List.replaceAll, Stream.reduce, Collectors.reducing, and minBy / maxBy.
Read MoreUse Java’s Supplier<T> for lazy values — get, orElseGet, factories, supplyAsync — so you do not build work until something actually needs the result.
Read MoreUse Java’s Consumer<T> for side effects — accept, andThen — and see where Stream.forEach, Optional.ifPresent, and peek already ask for it.
Read MoreUse Java’s Predicate<T> to test values — test, and, or, negate, isEqual, Predicate.not (Java 11) — and see where Stream.filter, anyMatch, and removeIf already ask for it.
Read MoreLearn the Linux filesystem hierarchy — what /, /etc, /var, /usr, /home and friends are for, and when to look in each one.
Read MoreUse Java’s Function<T,R> to map values — apply, compose, andThen, identity — and see where Stream.map, Optional.map, and Collectors already ask for it.
Read MoreWhat a Java functional interface is, the four shapes in java.util.function, when to write your own SAM type, and a living map of every post in this series.
Read More