@Test(expected = AssertionError.class) public void testNegativeRestDurationIsProhibited() { final ScanDuration duration = ScanDuration.preciseDuration(100L, -1); }
public static ScanDuration preciseDuration(@IntRange(from = 0) long scanDurationMillis, @IntRange(from = 0) long restDurationMillis) { if (scanDurationMillis < 0) { throw new AssertionError("Scan duration has to be non-negative; actual value is: " + scanDurationMillis); } if (restDurationMillis < 0) { throw new AssertionError("Rest duration has to be non-negative; actual value is: " + restDurationMillis); } return new ScanDuration(scanDurationMillis, restDurationMillis); }
ScanDuration { public static ScanDuration preciseDuration(@IntRange(from = 0) long scanDurationMillis, @IntRange(from = 0) long restDurationMillis) { if (scanDurationMillis < 0) { throw new AssertionError("Scan duration has to be non-negative; actual value is: " + scanDurationMillis); } if (restDurationMillis < 0) { throw new AssertionError("Rest duration has to be non-negative; actual value is: " + restDurationMillis); } return new ScanDuration(scanDurationMillis, restDurationMillis); } }
ScanDuration { public static ScanDuration preciseDuration(@IntRange(from = 0) long scanDurationMillis, @IntRange(from = 0) long restDurationMillis) { if (scanDurationMillis < 0) { throw new AssertionError("Scan duration has to be non-negative; actual value is: " + scanDurationMillis); } if (restDurationMillis < 0) { throw new AssertionError("Rest duration has to be non-negative; actual value is: " + restDurationMillis); } return new ScanDuration(scanDurationMillis, restDurationMillis); } private  ScanDuration(long scanDurationMillis,
                         long restDurationMillis); }
ScanDuration { public static ScanDuration preciseDuration(@IntRange(from = 0) long scanDurationMillis, @IntRange(from = 0) long restDurationMillis) { if (scanDurationMillis < 0) { throw new AssertionError("Scan duration has to be non-negative; actual value is: " + scanDurationMillis); } if (restDurationMillis < 0) { throw new AssertionError("Rest duration has to be non-negative; actual value is: " + restDurationMillis); } return new ScanDuration(scanDurationMillis, restDurationMillis); } private  ScanDuration(long scanDurationMillis,
                         long restDurationMillis); static ScanDuration preciseDuration(@IntRange(from = 0) long scanDurationMillis,
                                               @IntRange(from = 0) long restDurationMillis); }
ScanDuration { public static ScanDuration preciseDuration(@IntRange(from = 0) long scanDurationMillis, @IntRange(from = 0) long restDurationMillis) { if (scanDurationMillis < 0) { throw new AssertionError("Scan duration has to be non-negative; actual value is: " + scanDurationMillis); } if (restDurationMillis < 0) { throw new AssertionError("Rest duration has to be non-negative; actual value is: " + restDurationMillis); } return new ScanDuration(scanDurationMillis, restDurationMillis); } private  ScanDuration(long scanDurationMillis,
                         long restDurationMillis); static ScanDuration preciseDuration(@IntRange(from = 0) long scanDurationMillis,
                                               @IntRange(from = 0) long restDurationMillis); static final ScanDuration UNIFORM; }