@Test public void shouldSetNumberOfSegments() { final int anySegmentSizeLargerThanOne = 5; assertEquals(anySegmentSizeLargerThanOne, new TestWindows().segments(anySegmentSizeLargerThanOne).segments); }
protected Windows<W> segments(final int segments) throws IllegalArgumentException { if (segments < 2) { throw new IllegalArgumentException("Number of segments must be at least 2."); } this.segments = segments; return this; }
Windows { protected Windows<W> segments(final int segments) throws IllegalArgumentException { if (segments < 2) { throw new IllegalArgumentException("Number of segments must be at least 2."); } this.segments = segments; return this; } }
Windows { protected Windows<W> segments(final int segments) throws IllegalArgumentException { if (segments < 2) { throw new IllegalArgumentException("Number of segments must be at least 2."); } this.segments = segments; return this; } protected  Windows(); }
Windows { protected Windows<W> segments(final int segments) throws IllegalArgumentException { if (segments < 2) { throw new IllegalArgumentException("Number of segments must be at least 2."); } this.segments = segments; return this; } protected  Windows(); Windows<W> until(final long durationMs); long maintainMs(); abstract Map<Long, W> windowsFor(final long timestamp); abstract long size(); }
Windows { protected Windows<W> segments(final int segments) throws IllegalArgumentException { if (segments < 2) { throw new IllegalArgumentException("Number of segments must be at least 2."); } this.segments = segments; return this; } protected  Windows(); Windows<W> until(final long durationMs); long maintainMs(); abstract Map<Long, W> windowsFor(final long timestamp); abstract long size(); public int segments; }