Window { public long end(long position) { return start(position) + size - 1; } Window(final int size); long start(long position); long end(long position);  }
@Test public void testWindowEnd() { final Window victim = new Window(1000); assertEquals(1000, victim.end(1)); assertEquals(1000, victim.end(1000)); assertEquals(2000, victim.end(1001)); assertEquals(2000, victim.end(2000)); assertEquals(3000, victim.end(2001)); assertEquals(3000, victim.end(3000)); assertEquals(249251000, victim.end(249250621)); }