### Question:
NormalizerRMConnector implements RMConnector, RMListener { @Override public void release(Collection<RMResource> resources, boolean doNotCache) throws LlamaException { List<RMResource> toRemove = new ArrayList<RMResource>(); for (RMResource resource : resources) { ResourceEntry entry = removeEntry(resource.getResourceId()); if (entry != null) { toRemove.addAll(entry.getNormalized()); LOG.debug("Releasing '{}' normalized chunks for resource '{}'", entry.getNormalized().size(), resource.getResourceId()); } } connector.release(toRemove, doNotCache); } NormalizerRMConnector(Configuration conf, RMConnector connector); @Override void setMetricRegistry(MetricRegistry metricRegistry); @Override boolean hasResources(); @Override void deleteAllReservations(); @Override void setRMListener(RMListener listener); @Override void start(); @Override void stop(); @Override void register(String queue); @Override void unregister(); @Override List<NodeInfo> getNodes(); @Override void reserve(Collection<RMResource> resources); @Override void release(Collection<RMResource> resources, boolean doNotCache); @Override boolean reassignResource(Object rmResourceId, UUID resourceId); @Override void emptyCache(); @Override void stoppedByRM(); @Override @SuppressWarnings("unchecked") void onEvent(List<RMEvent> events);  }### Answer:
@Test @SuppressWarnings("unchecked") public void testRelease() throws LlamaException { RMResource request = TestUtils.createRMResource("node1", Locality.MUST, 3, 3000); normalizer.reserve(Arrays.asList(request)); normalizer.release(Arrays.asList(request), true); Assert.assertEquals("release", connector.invoked.get(2)); List<RMResource> normalResources = (List<RMResource>) connector.args.get(1); Assert.assertEquals(2 + 6, normalResources.size()); for (RMResource normalResource : normalResources) { Assert.assertTrue(!normalResource.getResourceId().equals(request.getResourceId())); } }