RowFilters { public static <M,I> RowFilter<M,I> regexFilter(String regex, int... indices) { return regexFilter(0, regex, indices); } private  RowFilters(); static RowFilter<M,I> regexFilter(String regex,
            int... indices); static RowFilter<M,I> regexFilter(int matchFlags, String regex,
            int... indices); static RowFilter<M,I> regexFilter(Pattern pattern,
                                                       int... indices);  }
@Test(expected = IllegalArgumentException.class) public void testIllegalArgumentOnNegative() { RowFilters.regexFilter(0, "some", -1); }
@Test(expected = NullPointerException.class) public void testNPEOnNullRegex() { RowFilters.regexFilter(0, null); }
@Test(expected = NullPointerException.class) public void testNPEOnNullPattern() { RowFilters.regexFilter((Pattern) null); }
@Test public void testCaseFlagAndColumn() { RowFilter<TableModel, Integer> filter = RowFilters.regexFilter(Pattern.CASE_INSENSITIVE, "jeff", 0); entry.modelIndex = 3; assertTrue(filter.include(entry)); }
@Test public void testCaseFlagAndColumnNoMatch() { RowFilter<TableModel, Integer> filter = RowFilters.regexFilter(Pattern.CASE_INSENSITIVE, "jeff", 1); entry.modelIndex = 3; assertFalse(filter.include(entry)); }
@Test public void testCaseFlag() { RowFilter<TableModel, Integer> filter = RowFilters.regexFilter(Pattern.CASE_INSENSITIVE, "jeff"); entry.modelIndex = 3; assertTrue(filter.include(entry)); }
@Test public void testDefaultCaseNoMatch() { RowFilter<TableModel, Integer> filter = RowFilters.regexFilter(0, "jeff"); entry.modelIndex = 3; assertFalse(filter.include(entry)); }
@Test public void testDefaultCaseMatch() { RowFilter<TableModel, Integer> filter = RowFilters.regexFilter("Jeff"); entry.modelIndex = 3; assertTrue(filter.include(entry)); }
@Test public void testExist() { RowFilters.regexFilter("sometext"); RowFilters.regexFilter("some", 0, 1, 3); RowFilters.regexFilter(Pattern.compile("text"), 0, 5); RowFilters.regexFilter(Pattern.compile("soem")); RowFilters.regexFilter(0, "some"); RowFilters.regexFilter(0, "some", 1); }