### Question:
InstanceResourceProvider extends AbstractDRResourceProvider { @Override public RequestStatus deleteResources(Request request, Predicate predicate) throws SystemException, UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException { IvoryService service = getService(); Set<Resource> resources = getResources(PropertyHelper.getReadRequest(), predicate); for (Resource resource : resources) { service.killInstance((String) resource.getPropertyValue(INSTANCE_FEED_NAME_PROPERTY_ID), (String) resource.getPropertyValue(INSTANCE_ID_PROPERTY_ID)); } return new RequestStatusImpl(null); } InstanceResourceProvider(IvoryService ivoryService); @Override RequestStatus createResources(Request request); @Override Set<Resource> getResources(Request request, Predicate predicate); @Override RequestStatus updateResources(Request request, Predicate predicate); @Override RequestStatus deleteResources(Request request, Predicate predicate);  }### Answer:
@Test public void testDeleteResources() throws Exception { IvoryService service = createMock(IvoryService.class); Instance instance1 = new Instance("Feed1", "Instance1", "SUBMITTED", "start", "end", "details", "log"); expect(service.getFeedNames()).andReturn(Collections.singletonList("Feed1")); expect(service.getInstances("Feed1")).andReturn(Collections.singletonList(instance1)); service.killInstance("Feed1", "Instance1"); replay(service); InstanceResourceProvider provider = new InstanceResourceProvider(service); Predicate predicate = new PredicateBuilder().property(InstanceResourceProvider.INSTANCE_ID_PROPERTY_ID).equals("Instance1").toPredicate(); provider.deleteResources(new RequestImpl(null, null, null, null), predicate); verify(service); }