@Test
  public void filterMatchesPositive() {
    List<String> candidates = ImmutableList.of("foo", "bar");
    List<String> expected = ImmutableList.of("foo");
    assertThat(filterMatches(candidates, new Pattern[]{Pattern.compile("f.*")}, null),
            is(expected));
  }
Test positive matches when some candidates match.
standalone-metastore/metastore-tools/tools-common/src/test/java/org/apache/hadoop/hive/metastore/tools/UtilTest.java