SearchCoverage { public Double getMinimum() { return minimum; } private  SearchCoverage(Builder builder); Double getMinimum(); Double getMinWaitAfterCoverageFactor(); Double getMaxWaitAfterCoverageFactor();  }
@Test public void requireThatInvalidMinimumCanNotBeSet() { SearchCoverage.Builder coverage = new SearchCoverage.Builder(); coverage.setMinimum(0.5); assertEquals(0.5, coverage.build().getMinimum(), 1E-6); try { coverage.setMinimum(-0.5); fail(); } catch (IllegalArgumentException e) { assertEquals("Expected value in range [0, 1], got -0.5.", e.getMessage()); } assertEquals(0.5, coverage.build().getMinimum(), 1E-6); try { coverage.setMinimum(1.5); fail(); } catch (IllegalArgumentException e) { assertEquals("Expected value in range [0, 1], got 1.5.", e.getMessage()); } assertEquals(0.5, coverage.build().getMinimum(), 1E-6); }