### Question:
CassandraInstanceResource { @GET public Set<CassandraInstance> findAll() { return service.findAll(ring.getName()); } @Inject  CassandraInstanceResource(CassandraInstanceService service, @Assisted CassandraRing ring); @GET Set<CassandraInstance> findAll(); @POST Response createInstance(@Valid CassandraInstance instance); @GET @Path("{id}") CassandraInstance findById(@PathParam("id") int id); @DELETE @Path("{id}") Response deleteInstance(@PathParam("id") int id);  }### Answer:
@Test public void findAll() throws Exception { CassandraInstance instance1 = createMock(CassandraInstance.class); CassandraInstance instance2 = createMock(CassandraInstance.class); ImmutableSet<CassandraInstance> instances = ImmutableSet.of(instance1, instance2); expect(service.findAll(RING_NAME)).andReturn(instances); replayAll(); assertEquals(instances, resource.findAll()); }