mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-19 01:50:56 +07:00
38 lines
832 B
Java
38 lines
832 B
Java
// "Replace lambda with method reference" "true-preview"
|
|
public class IDEA100452 {
|
|
public static <T> MatchOp<T> match(MatchOp.MatchKind matchKind) {
|
|
class MatchSink extends BooleanTerminalSink<T> {
|
|
|
|
private MatchSink() {
|
|
super(matchKind);
|
|
}
|
|
|
|
@Override
|
|
public void accept(T t) {
|
|
}
|
|
}
|
|
|
|
Supplier<BooleanTerminalSink<T>> s = () -> new Match<caret>Sink();
|
|
return new MatchOp<>(1, matchKind, s);
|
|
}
|
|
|
|
static abstract class BooleanTerminalSink<T> {
|
|
public BooleanTerminalSink(MatchOp.MatchKind matchKind) {
|
|
|
|
}
|
|
|
|
public abstract void accept(T t);
|
|
}
|
|
static interface Supplier<T> {
|
|
public T get();
|
|
}
|
|
|
|
static class MatchOp<H> {
|
|
public MatchOp(int i, MatchKind matchKind, Supplier<BooleanTerminalSink<H>> s) {
|
|
|
|
}
|
|
|
|
static enum MatchKind {}
|
|
}
|
|
}
|