@Test public void validateIsReferringTo() { final Long objOne = 42L; final Long objTwo = 43L; final WeakReference<Long> ref = new WeakReference<>(objOne); assertTrue(References.isReferringTo(ref, objOne)); assertFalse(References.isReferringTo(ref, objTwo)); }
public static <T> boolean isReferringTo(final Reference<T> ref, final T obj) { return ref.get() == obj; }
References { public static <T> boolean isReferringTo(final Reference<T> ref, final T obj) { return ref.get() == obj; } }
References { public static <T> boolean isReferringTo(final Reference<T> ref, final T obj) { return ref.get() == obj; } private  References(); }
References { public static <T> boolean isReferringTo(final Reference<T> ref, final T obj) { return ref.get() == obj; } private  References(); static boolean isCleared(final Reference<?> ref); static boolean isReferringTo(final Reference<T> ref, final T obj); }
References { public static <T> boolean isReferringTo(final Reference<T> ref, final T obj) { return ref.get() == obj; } private  References(); static boolean isCleared(final Reference<?> ref); static boolean isReferringTo(final Reference<T> ref, final T obj);  }