@Test
  public void filterMatchesMultiple() {
    List<String> candidates = ImmutableList.of("a", "b", "any", "boom", "hello");
    List<String> patterns = ImmutableList.of("^a", "!y$");
    List<String> expected = ImmutableList.of("a");
    assertThat(filterMatches(candidates, new Pattern[]{Pattern.compile("^a")}, new Pattern[]{Pattern.compile("y$")}),
            is(expected));
  }
Test that multiple patterns are handled correctly. We use one positive and one negative parrent.
standalone-metastore/metastore-tools/tools-common/src/test/java/org/apache/hadoop/hive/metastore/tools/UtilTest.java