### Question:
TableFilter { public boolean isIncludeTable(String tableName) { PatternFilter columnFilter = getIncludeTableColumnFilter(tableName); return columnFilter != null; } TableFilter(SortedSet<IncludeTableFilter> includes, SortedSet<Pattern> excludes); boolean isIncludeTable(String tableName); PatternFilter getIncludeTableColumnFilter(String tableName); PatternFilter getIncludeTableRelationshipFilter(String tableName); SortedSet<IncludeTableFilter> getIncludes(); static TableFilter include(String tablePattern); static TableFilter everything(); @Override boolean equals(Object o); @Override int hashCode();  }### Answer:
@Test public void testExclude() { TreeSet<Pattern> excludes = new TreeSet<>(PatternFilter.PATTERN_COMPARATOR); excludes.add(Pattern.compile("aaa")); excludes.add(Pattern.compile("bb")); TreeSet<IncludeTableFilter> includes = new TreeSet<>(); includes.add(new IncludeTableFilter(null, PatternFilter.INCLUDE_EVERYTHING)); TableFilter filter = new TableFilter(includes, excludes); assertFalse(filter.isIncludeTable("aaa")); assertTrue(filter.isIncludeTable("aa")); assertTrue(filter.isIncludeTable("aaaa")); assertFalse(filter.isIncludeTable("bb")); assertTrue(filter.isIncludeTable("")); assertTrue(filter.isIncludeTable("bbbb")); }
@Test public void testIncludeExclude() { TreeSet<Pattern> excludes = new TreeSet<>(PatternFilter.PATTERN_COMPARATOR); excludes.add(Pattern.compile("aaa")); excludes.add(Pattern.compile("bb")); TreeSet<IncludeTableFilter> includes = new TreeSet<>(); includes.add(new IncludeTableFilter("aa.*")); TableFilter filter = new TableFilter(includes, excludes); assertFalse(filter.isIncludeTable("aaa")); assertTrue(filter.isIncludeTable("aa")); assertTrue(filter.isIncludeTable("aaaa")); assertFalse(filter.isIncludeTable("bb")); assertFalse(filter.isIncludeTable("")); assertFalse(filter.isIncludeTable("bbbb")); }