// "Replace lambda with method reference" "true-preview" public class IDEA100452 { public static MatchOp match(MatchOp.MatchKind matchKind) { class MatchSink extends BooleanTerminalSink { private MatchSink() { super(matchKind); } @Override public void accept(T t) { } } Supplier> s = MatchSink::new; return new MatchOp<>(1, matchKind, s); } static abstract class BooleanTerminalSink { public BooleanTerminalSink(MatchOp.MatchKind matchKind) { } public abstract void accept(T t); } static interface Supplier { public T get(); } static class MatchOp { public MatchOp(int i, MatchKind matchKind, Supplier> s) { } static enum MatchKind {} } }