Creating String representation of lambda expression [duplicate]

The simplest thing I could come up with is creating a “named predicate” that gives your predicates a name or description, basically anything that will be useful as a toString: public class NamedPredicate<T> implements Predicate<T> { private final String name; private final Predicate<T> predicate; public NamedPredicate(String name, Predicate<T> predicate) { this.name = name; this.predicate = … Read more