import java.io.IOException; abstract class Ambiguity { public abstract T executeServerOperation(ThrowableComputable computable); public T executeServerOperation(final Computable computable) { return null; } boolean foo(Ambiguity a, String s){ return a.executeServerOperation(() -> bool(s, a)); } protected abstract boolean bool(String s, Ambiguity a); } interface ThrowableComputable { T compute() throws E; } interface Computable { T compute(); }