### Question:
BlockProcessor { public void process( int number ) { for ( int i = 0; i < number; i++) { everyTime( i ); if ( i % blockSize == blockSize - 1 || i == number - 1 ) { everyBlock( i ); } } blocksComplete(); } BlockProcessor( int blockSize ); void process( int number ); abstract void everyTime( int count ); abstract void everyBlock( int count ); void blocksComplete();  }### Answer:
@Test public void testProcessItemsLessThanBlockSize() throws Exception { TestBlockProcessor bp100 = new TestBlockProcessor( 100 ); bp100.process( 1 ); assertTrue( blocksDone == 1 ); assertTrue( itemsDone == 1 ); }
@Test public void testProcessItemsEqualsBlockSize() throws Exception { TestBlockProcessor bp100 = new TestBlockProcessor( 100 ); bp100.process( 100 ); assertTrue( blocksDone == 1 ); assertTrue( itemsDone == 100 ); }
@Test public void testProcessItemsExactMultipleOfBlockSize() throws Exception { TestBlockProcessor bp100 = new TestBlockProcessor( 100 ); bp100.process( 100 * 5 ); assertTrue( blocksDone == 5 ); assertTrue( itemsDone == 100 * 5 ); }
@Test public void testProcessItemsInBetweenMultiplesOfBlockSize() throws Exception { TestBlockProcessor bp100 = new TestBlockProcessor( 100 ); bp100.process( 443 ); assertTrue( blocksDone == 5 ); assertTrue( itemsDone == 443 ); }