### Question:
RepositoryScrollPersister implements ScrollPersister { @Override public boolean hasAny() { return !listAll().isEmpty(); } RepositoryScrollPersister(Repository model, Clock clock); @Override void saveScroll(Scroll scroll); @Override Scroll loadScroll(RepositoryId id); @Override Scroll newScroll(); @Override Collection<ScrollReference> listAll(); @Override boolean hasAny(); RepositoryId createRepositoryId();  }### Answer:
@Test public void freshPersisterHasNoScrolls() throws Exception { ReferenceAccess access = DummyAccess.empty(); when(repository.createReferenceAccess(eq(ITEM_TYPE), any(ReferenceBuilder.class))).thenReturn(access); assertThat(persister.hasAny(), is(false)); }
@Test public void hasScrollsIfRepositoryDiscoversSome() throws Exception { ReferenceAccess access = DummyAccess.filled(); when(repository.createReferenceAccess(eq(ITEM_TYPE), any(ReferenceBuilder.class))).thenReturn(access); assertThat(persister.hasAny(), is(true)); }
@Ignore @Test public void freshPersisterHasNoScrolls() throws Exception { ReferenceAccess access = DummyAccess.empty(); assertThat(persister.hasAny(), is(false)); }
@Ignore @Test public void hasScrollsIfRepositoryDiscoversSome() throws Exception { ReferenceAccess access = DummyAccess.filled(); assertThat(persister.hasAny(), is(true)); }