208: @Test public void testIncrement_existingKey() { 209: assertEquals(9, tally.get("key1")); 210: }
1: private final Tally tally = new Tally(); 2: @Before public void setUp() { 3: tally.increment("key1", 8); 4: tally.increment("key2", 100); 5: tally.increment("key1", 0); 6: tally.increment("key1", 1); 7: } // 200 lines away 208: @Test public void testIncrement_existingKey() { 209: assertEquals(9, tally.get("key1")); 210: }
1: private final Tally tally = new Tally(); 2: @Test public void testIncrement_newKey() { 3: tally.increment("key", 100); 5: assertEquals(100, tally.get("key")); 6: } 7: @Test public void testIncrement_existingKey() { 8: tally.increment("key", 8); 9: tally.increment("key", 1); 10: assertEquals(9, tally.get("key")); 11: } 12: @Test public void testIncrement_incrementByZeroDoesNothing() { 13: tally.increment("key", 8); 14: tally.increment("key", 0); 15: assertEquals(8, tally.get("key")); 16: }