smooth.calculateCost(sR);
double ans1 = 0, ans2 = 0;
// reuse
HSA hsaEngine2 = new HSA(1, 1, cost, new UnorderedMatcherFactory(),
true);
hsaEngine2.computeHSA(t, s);
ans1 = hsaEngine2.computeHSA(t, sR);
// no reuse
hsaEngine2 = new HSA(1, 1, cost, new UnorderedMatcherFactory(), true);
hsaEngine2.computeHSA(t, s);
hsaEngine2.setFactory(new UnorderedMatcherFactory());
ans2 = hsaEngine2.computeHSA(t, sR);
Assert.assertEquals("Got a problem with the matchers", true,
MathOperations.equals(ans1, ans2));
}