### Question:
TransparentEqualsWeakReference extends WeakReference<T> { @Override public int hashCode() { return myHashCode; } TransparentEqualsWeakReference(T referent);  TransparentEqualsWeakReference(T referent, ReferenceQueue<? super T> q); static TransparentEqualsWeakReference<T> create(T referent); static TransparentEqualsWeakReference<T> create(T referent, ReferenceQueue<? super T> q); @Override @SuppressWarnings("PMD.CompareObjectsWithEquals") boolean equals(Object obj); @Override int hashCode();  }### Answer:
@Test public void testHashCode() { TestClass testObj1 = new TestClass(); TestClass testObj2 = new TestClass(); TransparentEqualsWeakReference<TestClass> ref1a = new TransparentEqualsWeakReference<TransparentEqualsWeakReferenceTest.TestClass>( testObj1); TransparentEqualsWeakReference<TestClass> ref1b = new TransparentEqualsWeakReference<TransparentEqualsWeakReferenceTest.TestClass>( testObj1); TransparentEqualsWeakReference<TestClass> ref2 = new TransparentEqualsWeakReference<TransparentEqualsWeakReferenceTest.TestClass>( testObj2); Assert.assertTrue(ref1a.hashCode() == ref1b.hashCode()); Assert.assertTrue(ref1a.hashCode() != ref2.hashCode()); }