### Question:
CassandraRingResource { @GET public Set<CassandraRing> findAll() { return service.findAll(); } @Inject  CassandraRingResource(CassandraRingService service,
      CassandraInstanceResourceFactory instanceResourceFactory,
      SeedResourceFactory seedResourceFactory); @GET Set<CassandraRing> findAll(); @POST Response createRing(@Valid CassandraRing ring); @GET @Path("{name}") CassandraRing findByName(@PathParam("name") String name); @DELETE @Path("{name}") Response deleteRing(@PathParam("name") String name); @Path("{name}/instances") CassandraInstanceResource getCassandraInstanceResource(@PathParam("name") String name); @Path("{name}/seeds") SeedResource getSeedResource(@PathParam("name") String name);  }### Answer:
@Test public void findAll() throws Exception { CassandraRing ring1 = createMock(CassandraRing.class); CassandraRing ring2 = createMock(CassandraRing.class); ImmutableSet<CassandraRing> rings = ImmutableSet.of(ring1, ring2); expect(service.findAll()).andReturn(rings); replayAll(); assertEquals(rings, resource.findAll()); }