### Question:
BWList { public boolean matches(Map<String, String> targets, BWResult result) throws IllegalStateException { return this.data.matches(targets, result); } private  BWList(); static BWList createDefaultBWList(); BWList addMatcher(Class<? extends Matcher> matcherClass); BWList setSourceLoader(String scheme, SourceLoader loader); SourceLoader findSourceLoader(String str, SourceLoader defaultLoader); MatcherConf getMatcherConf(String matcherName); Source add(URI uri); BWList remove(int sourceId); BWList compile(); boolean check(boolean forceReload); boolean matches(Map<String, String> targets, BWResult result);  }### Answer:
@Test(dataProvider = "matches") public void testMatches(URI[] uris, Map<String, String> target, int[] matchIndexes) throws CompileException { BWList bwlist = BWList.createDefaultBWList(); List<Source> sources = new ArrayList<>(uris.length); for (URI uri : uris) { sources.add(bwlist.add(uri)); } bwlist.compile(); BWResult result = new BWResult(); bwlist.matches(target, result); Set<Integer> matchIndexSet = new HashSet<>(); for (int idx : matchIndexes) { matchIndexSet.add(idx); } Set<Integer> resultSet = new HashSet<>(); for (Integer sid : result) { for (int i = 0; i < sources.size(); i++) { if (sources.get(i).getId() == sid) { resultSet.add(i); break; } } } Assert.assertEquals(resultSet, matchIndexSet); }