Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
public class TestJdk12Regression {
@FunctionalInterface
interface HandleCallback<T, X extends Exception> {
T withHandle(Handle handle) throws X;
}
@FunctionalInterface
interface HandleConsumer<X extends Exception> {
void useHandle(Handle handle) throws X;
}
interface Handle {}
interface Jdbi {
<R, X extends Exception> R withHandle(HandleCallback<R, X> callback) throws X;
<X extends Exception> void useHandle(final HandleConsumer<X> callback) throws X;
}
interface ObjectAssert<ACTUAL> {
void isSameAs(ACTUAL t);
}
static <T> ObjectAssert<T> assertThat(T actual) {
return null;
}
private Jdbi jdbi;
public void nestedUseHandle() {
jdbi.withHandle(h1 -> {
jdbi.useHandle(h2 ->
assertThat(h1).isSameAs(h2));
return null;
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.