### Question:
InPredicate implements Predicate<Object> { @Override public boolean test(Object input) { return myAllowed.contains(input); } InPredicate(Collection<? extends Object> allowed); @Override boolean equals(Object obj); @Override int hashCode(); @Override boolean test(Object input);  }### Answer:
@Test public void test() { InPredicate predicate = new InPredicate(Arrays.asList("one", "two", "three")); Assert.assertFalse(predicate.test(null)); Assert.assertFalse(predicate.test("")); Assert.assertFalse(predicate.test("One")); Assert.assertTrue(predicate.test("one")); Assert.assertTrue(predicate.test("two")); Assert.assertTrue(predicate.test("three")); }