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