@Test public void validateIsCleared() { BigInteger bigInteger = new BigInteger("42"); final WeakReference<BigInteger> ref = new WeakReference<>(bigInteger); assertFalse(References.isCleared(ref)); bigInteger = null; System.gc(); assertTrue(References.isCleared(ref)); }
public static boolean isCleared(final Reference<?> ref) { return ref.get() == null; }
References { public static boolean isCleared(final Reference<?> ref) { return ref.get() == null; } }
References { public static boolean isCleared(final Reference<?> ref) { return ref.get() == null; } private  References(); }
References { public static boolean isCleared(final Reference<?> ref) { return ref.get() == null; } private  References(); static boolean isCleared(final Reference<?> ref); static boolean isReferringTo(final Reference<T> ref, final T obj); }
References { public static boolean isCleared(final Reference<?> ref) { return ref.get() == null; } private  References(); static boolean isCleared(final Reference<?> ref); static boolean isReferringTo(final Reference<T> ref, final T obj);  }