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