dfa: understand assertThat notnull (IDEA-125977, IDEA-65004)

This commit is contained in:
peter
2014-07-18 09:14:04 +02:00
parent 2a3e157275
commit 6d9cf39e0e
5 changed files with 161 additions and 42 deletions
@@ -0,0 +1,18 @@
import org.hamcrest.CoreMatchers;
import org.jetbrains.annotations.Nullable;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.assertThat;
class Contracts {
private void checkNotNullValue(@Nullable Object o) {
assertThat(o, CoreMatchers.<Object>notNullValue());
System.out.println(o.hashCode());
}
private void checkNotEqualToNull(@Nullable String test) {
assertThat("String is null", test, not(equalTo(null)));
int length = test.length();
}
}