CommDeviceBuilder { public CommDeviceBuilder setReliability(double reliability) { CommModel.checkReliability(reliability); deviceReliability = reliability; return this; } CommDeviceBuilder(CommModel m, CommUser u); CommDeviceBuilder setReliability(double reliability); CommDeviceBuilder setMaxRange(double range); CommDevice build();  }
@Test public void testSetReliability() { assertEquals(0d, builder.setReliability(0).build().getReliability(), 0d); setUp(); assertEquals(1d, builder.setReliability(1).build().getReliability(), 0d); boolean fail = false; try { builder.setReliability(1.0000001); } catch (final IllegalArgumentException e) { fail = true; } assertTrue(fail); fail = false; try { builder.setReliability(-0.0000001); } catch (final IllegalArgumentException e) { fail = true; } assertTrue(fail); }