import java.io.IOException; class MethodReferenceErrorHighlight { { match(String.class, this::foo); }

void match(final Class

type, UnitApply

apply) {} void foo(String s) throws IOException { throw new IOException(); } } interface UnitApply { void apply(I i) throws Exception; }