### Question:
ZergCassandraRingDao implements CassandraRingDao { @Override public ImmutableSet<CassandraRing> findAll() throws BackingStoreException { ImmutableSet.Builder<CassandraRing> ringBuilder = ImmutableSet.builder(); ZergHosts hosts = ZergHosts.from(zergConnector.getHosts()); for (String ring : hosts.rings()) { ringBuilder.add(buildRingFromHosts(ring, hosts)); } return ringBuilder.build(); } @Inject  ZergCassandraRingDao(ZergConnector zergConnector,
      @Named(ZergDaoModule.ZERG_REGION_PROPERTY) String currentRegion,
      @Named(ZergDaoModule.ZERG_CASSANDRA_RING_SCOPES) Map<String, String> ringScopes); @Override ImmutableSet<CassandraRing> findAll(); @Override @Nullable CassandraRing findByName(String name); @Override void save(CassandraRing ring); @Override void delete(CassandraRing ring);  }### Answer:
@Test public void findAll() throws Exception { expect(zergConnector.getHosts()).andReturn(HOSTS); replayAll(); assertEquals(RINGS, dao.findAll()); }
@Test public void findAll_emptyManifest() throws Exception { expect(zergConnector.getHosts()).andReturn(ImmutableSet.<ZergHost>of()); replayAll(); assertEquals(ImmutableSet.of(), dao.findAll()); }
@Test(expected = BackingStoreException.class) public void findAll_backingStoreException() throws Exception { expect(zergConnector.getHosts()).andThrow(new BackingStoreException()); replayAll(); dao.findAll(); }