@Test public void testNexusEquality() throws Exception { Constructor<Nexus> constructor = Nexus.class.getDeclaredConstructor(String.class, ClassLoader.class, ReferenceQueue.class, int.class); constructor.setAccessible(true); assertThat(constructor.newInstance(FOO, classLoader, null, BAR), is(constructor.newInstance(FOO, classLoader, null, BAR))); assertThat(constructor.newInstance(FOO, classLoader, null, BAR).hashCode(), is(constructor.newInstance(FOO, classLoader, null, BAR).hashCode())); }
@Override public int hashCode() { int result = name.hashCode(); result = 31 * result + classLoaderHashCode; result = 31 * result + identification; return result; }
Nexus extends WeakReference<ClassLoader> { @Override public int hashCode() { int result = name.hashCode(); result = 31 * result + classLoaderHashCode; result = 31 * result + identification; return result; } }
Nexus extends WeakReference<ClassLoader> { @Override public int hashCode() { int result = name.hashCode(); result = 31 * result + classLoaderHashCode; result = 31 * result + identification; return result; } private  Nexus(Class<?> type, int identification); private  Nexus(String name, ClassLoader classLoader, ReferenceQueue<? super ClassLoader> referenceQueue, int identification); }
Nexus extends WeakReference<ClassLoader> { @Override public int hashCode() { int result = name.hashCode(); result = 31 * result + classLoaderHashCode; result = 31 * result + identification; return result; } private  Nexus(Class<?> type, int identification); private  Nexus(String name, ClassLoader classLoader, ReferenceQueue<? super ClassLoader> referenceQueue, int identification); @SuppressWarnings("unused") static void initialize(Class<?> type, int identification); static void register(String name, ClassLoader classLoader, ReferenceQueue<? super ClassLoader> referenceQueue, int identification, Object typeInitializer); static void clean(Reference<? super ClassLoader> reference); @Override int hashCode(); @Override boolean equals(Object other); @Override String toString(); }
Nexus extends WeakReference<ClassLoader> { @Override public int hashCode() { int result = name.hashCode(); result = 31 * result + classLoaderHashCode; result = 31 * result + identification; return result; } private  Nexus(Class<?> type, int identification); private  Nexus(String name, ClassLoader classLoader, ReferenceQueue<? super ClassLoader> referenceQueue, int identification); @SuppressWarnings("unused") static void initialize(Class<?> type, int identification); static void register(String name, ClassLoader classLoader, ReferenceQueue<? super ClassLoader> referenceQueue, int identification, Object typeInitializer); static void clean(Reference<? super ClassLoader> reference); @Override int hashCode(); @Override boolean equals(Object other); @Override String toString(); static final String PROPERTY; }