Exemple #1
0
 @Test
 public void hasHashCodeWithoutJavaClass() {
   TestClass testClass = new TestClass(null);
   testClass.hashCode();
   // everything is fine if no exception is thrown.
 }
Exemple #2
0
 @Test
 public void hasSameHashCodeAsTestClassThatWrapsSameJavaClass() {
   TestClass testClass = new TestClass(DummyClass.class);
   TestClass testClassThatWrapsSameJavaClass = new TestClass(DummyClass.class);
   assertEquals(testClass.hashCode(), testClassThatWrapsSameJavaClass.hashCode());
 }