Created
April 9, 2019 17:44
-
-
Save stevenschlansker/a23cc97fb6d15fad6ae04bf54511ce62 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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