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