IntPairComparator comp = new IntPairComparator();
ArrayList<IntPair> ans = new ArrayList<IntPair>();
ArrayList<IntPair> exp = new ArrayList<IntPair>();
ans.add(new IntPair(6, 3));
ans.add(new IntPair(5, 2));
ans.add(new IntPair(4, 1));
for (int i = 0; i < matching[0].size(); ++i) {
exp.add(new IntPair(matching[0].get(i), matching[1].get(i)));
}
Collections.sort(ans, comp);
Collections.sort(exp, comp);
isSame(ans, exp);
Assert.assertEquals("Minimum matching answer is wrong", 7,
matcher.minCostMatching(), 0.001);
ans = new ArrayList<IntPair>();
exp = new ArrayList<IntPair>();
matching = matcher.getCurrMatching();
ans.add(new IntPair(3, 5));
ans.add(new IntPair(0, 4));
ans.add(new IntPair(6, 3));
ans.add(new IntPair(5, 2));
ans.add(new IntPair(4, 1));
for (int i = 0; i < matching[0].size(); ++i) {
exp.add(new IntPair(matching[0].get(i), matching[1].get(i)));
}
Collections.sort(ans, comp);
Collections.sort(exp, comp);