### Question:
FeatureFilter { public static boolean isMatch(Feature feature, String text) { if (text.startsWith("@")) { List<String> tags = getGroupTags(text); TagPredicate tp = new TagPredicate(tags); for (Pickle pe : feature.getPickles()) { if (tp.test(pe)) { return true; } } } else { if (feature.getName().equalsIgnoreCase(text) || feature.getUri().toString() .substring(feature.getUri().toString().lastIndexOf("/") + 1).equalsIgnoreCase(text)) return true; } return false; } FeatureFilter(List<Feature> features); List<Feature> filter(String text); static boolean isMatch(Feature feature, String text); static List<String> getGroupTags(String text); static Pattern TAG_PATTERN; }### Answer:
@Test public void isMatchTrueTest() { PerfRuntimeOptions options = new PerfRuntimeOptions(Arrays.asList(new String[] {"-g steps","src/test/java/resources"})); List<Feature> features = FeatureBuilder.getFeatures(FeatureBuilder.createRuntimeOptions(options.getCucumberOptions())); assertTrue(FeatureFilter.isMatch(features.get(1), "@onlyfilter")); }
@Test public void isMatchFalseTest() { PerfRuntimeOptions options = new PerfRuntimeOptions(Arrays.asList(new String[] {"-g steps","src/test/java/resources"})); List<Feature> features = FeatureBuilder.getFeatures(FeatureBuilder.createRuntimeOptions(options.getCucumberOptions())); assertFalse(FeatureFilter.isMatch(features.get(0), "@notefilter")); }