private void fillServerMap() { registerWithServerMap(firstKey); for (int i = 0; i < (numKeys - 2); i++) { registerWithServerMap("middle" + i); } registerWithServerMap(lastKey); assertThat(serverStore.get(lastKey), is(maxValue - 1)); }
@Test public void lastKeyReturnsMaxValue() { fillServerMap(); assertThat(serverStore.get(lastKey), is(maxValue - 1)); }
@Test public void firstKeyReturnsMinValue() { fillServerMap(); assertThat(serverStore.get(firstKey), is(minValue)); }
@Test public void getNonexistingReturnsNull() { fillServerMap(); assertNull(serverStore.get("unusedKey")); }