ContextStore implements Iterable<Resource> { void increment(Resource context) { contextInfoMap.merge(context, 1L, (size, one) -> size + one); contentsChanged = true; } ContextStore(NativeSailStore store, File dataDir); @Override Iterator<Resource> iterator();  }
@Test public void testIncrementNew() throws Exception { subject.increment(g1); assertThat(countContexts(subject)).isEqualTo(1); }
@Test public void testIncrementNewBNode() throws Exception { subject.increment(g2); assertThat(countContexts(subject)).isEqualTo(1); }
@Test public void testIncrementExisting() throws Exception { subject.increment(g1); subject.increment(g1); assertThat(countContexts(subject)).isEqualTo(1); }