### Question:
Algorithm { static Predicate<String> contains(final String subString) { return new Predicate<String>() { @Override public boolean test(String string) { return string.contains(subString); } }; }  static ArrayList<E> findAll(Ite input, Predicate<E> predicate);  }### Answer:
@Test public void testContain() { Predicate<String> containString = contains("string"); assertThat(containString.test("This is a string"), is(true)); assertThat(containString.test("string string"), is(true)); assertThat(containString.test("This is a String"), is(false)); assertThat(containString.test(""), is(false)); }