Skip to content

Instantly share code, notes, and snippets.

@thieux
thieux / StringTest.java
Created July 12, 2016 23:26
Java String split behavior
import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat;
public class StringTest {
@Test
public void empty_regex_on_empty_char() {
assertThat("".split("")).isEqualTo(new String[]{""});
}
@thieux
thieux / Java8MethodRef
Created June 26, 2016 22:51
Java8 method reference
class Java8MethodRef {
interface Equality1 {
boolean eq(Object a);
}
interface Equality2 {
boolean eq(Object a, Object b);
}