@Test public void testExactReclaimer() { Predicate<GCGeneration> reclaimer = newExactReclaimer(newGCGeneration(3, 3, false)); assertTrue(reclaimer.apply(newGCGeneration(3, 3, false))); assertFalse(reclaimer.apply(newGCGeneration(3, 3, true))); assertFalse(reclaimer.apply(newGCGeneration(3, 2, false))); assertFalse(reclaimer.apply(newGCGeneration(2, 3, false))); }
static Predicate<GCGeneration> newExactReclaimer(@NotNull final GCGeneration referenceGeneration) { return new Predicate<GCGeneration>() { @Override public boolean apply(GCGeneration generation) { return generation.equals(referenceGeneration); } @Override public String toString() { return "(generation==" + referenceGeneration + ")"; } }; }
Reclaimers { static Predicate<GCGeneration> newExactReclaimer(@NotNull final GCGeneration referenceGeneration) { return new Predicate<GCGeneration>() { @Override public boolean apply(GCGeneration generation) { return generation.equals(referenceGeneration); } @Override public String toString() { return "(generation==" + referenceGeneration + ")"; } }; } }
Reclaimers { static Predicate<GCGeneration> newExactReclaimer(@NotNull final GCGeneration referenceGeneration) { return new Predicate<GCGeneration>() { @Override public boolean apply(GCGeneration generation) { return generation.equals(referenceGeneration); } @Override public String toString() { return "(generation==" + referenceGeneration + ")"; } }; } private  Reclaimers(); }
Reclaimers { static Predicate<GCGeneration> newExactReclaimer(@NotNull final GCGeneration referenceGeneration) { return new Predicate<GCGeneration>() { @Override public boolean apply(GCGeneration generation) { return generation.equals(referenceGeneration); } @Override public String toString() { return "(generation==" + referenceGeneration + ")"; } }; } private  Reclaimers();  }
Reclaimers { static Predicate<GCGeneration> newExactReclaimer(@NotNull final GCGeneration referenceGeneration) { return new Predicate<GCGeneration>() { @Override public boolean apply(GCGeneration generation) { return generation.equals(referenceGeneration); } @Override public String toString() { return "(generation==" + referenceGeneration + ")"; } }; } private  Reclaimers();   }