/**
* Tests for the {@link Penalty} class.
* @throws Exception if an error occurs
*/
public void testPenalty() throws Exception {
Penalty p1 = Penalty.toPenalty(100);
assertEquals(100, p1.getValue());
Penalty p2 = p1.add(Penalty.toPenalty(50));
assertEquals(150, p2.getValue());
p1 = Penalty.toPenalty(0);
assertEquals(0, p1.getValue());
p1 = Penalty.INFINITE_PENALTY;
assertEquals(Integer.MAX_VALUE, p1.getValue());
assertTrue(p1.isInfinitePenalty());
p2 = p1.add(p2);
assertEquals(Integer.MAX_VALUE, p2.getValue());
assertTrue(p2.isInfinitePenalty());
}