Locations { public static Builder builder() { return new Builder(); } private  Locations(); static Builder builder();  }
@Test public void testFixed() { final LocationGenerator lg = Locations.builder().buildFixed( asList(new Point(0, 0), new Point(1, 1))); assertAlwaysEquals(lg); assertEquals(new Point(.5, .5), lg.getCenter()); assertEquals(new Point(0, 0), lg.getMin()); assertEquals(new Point(1, 1), lg.getMax()); final LocationGenerator lg2 = Locations.builder() .min(-6.3) .max(9.3) .mean(0.1) .buildFixed( asList(new Point(0, 0), new Point(1, 1))); assertAlwaysEquals(lg2); assertEquals(new Point(.1, .1), lg2.getCenter()); assertEquals(new Point(-6.3, -6.3), lg2.getMin()); assertEquals(new Point(9.3, 9.3), lg2.getMax()); TestUtil.testPrivateConstructor(Locations.class); }
@Test(expected = IllegalArgumentException.class) public void testFixedFail() { Locations.builder().buildFixed(asList(new Point(0, 0), new Point(1, 1))) .generate(0L, 3); }