@Override
	public Set<Integer> sample(Map<Integer, Set<Integer>> cluster,List<sei.buaa.program.analyzer.TestCase> tests) {

		
		Set<Integer> result = new HashSet<Integer>();

		Set<Integer> failedTestCaseIDS = new TreeSet<Integer>();
		for (sei.buaa.program.analyzer.TestCase test : tests)
			if (test.isPassed() == false)
				failedTestCaseIDS.add(test.getId());
		
		for (Integer key : cluster.keySet()) {
			Set<Integer> set = cluster.get(key);
			for (Integer failedTestID : failedTestCaseIDS) {
				if (set.contains(failedTestID)) {
					result.addAll(set);
					break;
				}
			}
		}

		for (Integer v : failedTestCaseIDS)
			if (result.contains(v))
				result.remove(v);

		return result;

	}