1920212223242526272829
Mean averager = new Mean(); averager.add(zero); averager.add(one); Point averageA = averager.toPoint(); assertEquals(half, averageA); averager.reset(); averager.add(zero); averager.add(zero);
2829303132333435363738
averager.add(zero); averager.add(zero); averager.add(zero); averager.add(one); Point averageB = averager.toPoint(); assertEquals(quarter, averageB); } @Test
606162636465666768
} @Test(expected=IllegalStateException.class) public void testToPoint() { Mean mean = new Mean(); mean.toPoint(); } }