ConcreteIntPredicate implements IntPredicate { public static ConcreteIntPredicate eq(int i) { return new EqualsIntPredicate(i); } private  ConcreteIntPredicate(); @Override final ConcreteIntPredicate and(IntPredicate intPredicate); @Override final ConcreteIntPredicate negate(); @Override final ConcreteIntPredicate or(IntPredicate intPredicate); @Override @SuppressFBWarnings(value = "AOM_ABSTRACT_OVERRIDDEN_METHOD", justification = "We want subclasses to implement this") abstract int hashCode(); @Override @SuppressFBWarnings(value = "AOM_ABSTRACT_OVERRIDDEN_METHOD", justification = "We want subclasses to implement this") abstract boolean equals(Object o); @Override @SuppressFBWarnings(value = "AOM_ABSTRACT_OVERRIDDEN_METHOD", justification = "We want subclasses to implement this") abstract String toString(); static ConcreteIntPredicate gt(int i); static ConcreteIntPredicate gte(int i); static ConcreteIntPredicate lte(int i); static ConcreteIntPredicate lt(int i); static ConcreteIntPredicate eq(int i);  }
@Test public void testEq() { int v = 100; ConcreteIntPredicate eqP = eq(100); assertTrue(eqP.test(v)); assertFalse(eqP.test(v - 1)); assertFalse(eqP.test(v + 1)); assertEquals(eq(v), eqP); assertEquals(eq(v).hashCode(), eqP.hashCode()); assertNotEquals(lt(v), eqP); assertNotEquals(eq(v + 1), eqP); assertEquals(eqP.toString(), "= 100"); }