Last active
July 20, 2018 00:14
-
-
Save ruimo/5f4a89fa3ff3da34606b295506a8a4c5 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 FooTest { | |
static class WithValue<T> { | |
final T v; | |
WithValue(T v) { | |
this.v = v; | |
} | |
void doTest(Consumer<T> f) { | |
f.accept(v); | |
} | |
} | |
<T> WithValue<T> with(T v) { | |
return new WithValue(v); | |
} | |
@Test public emptyString() { | |
with("").doTest(s -> assertEquals(0, s.length())); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment