@Test public void matches() { ResourceReferenceHandler resourceReferenceHandler1 = mock(ResourceReferenceHandler.class); ResourceReferenceHandler resourceReferenceHandler2 = mock(ResourceReferenceHandler.class); ResourceType resourceType1 = new ResourceType("test1"); ResourceType resourceType2 = new ResourceType("test2"); when(resourceReferenceHandler1.getSupportedResourceReferences()).thenReturn(Arrays.asList(resourceType1)); when(resourceReferenceHandler2.getSupportedResourceReferences()).thenReturn(Arrays.asList(resourceType1, resourceType2)); assertTrue(handlerManager.matches(resourceReferenceHandler1, resourceType1)); assertFalse(handlerManager.matches(resourceReferenceHandler1, resourceType2)); assertTrue(handlerManager.matches(resourceReferenceHandler2, resourceType1)); assertTrue(handlerManager.matches(resourceReferenceHandler2, resourceType2)); }
@Override protected boolean matches(ResourceReferenceHandler handler, ResourceType resourceType) { return handler.getSupportedResourceReferences().contains(resourceType); }
MainResourceReferenceHandlerManager extends AbstractResourceReferenceHandlerManager<ResourceType> { @Override protected boolean matches(ResourceReferenceHandler handler, ResourceType resourceType) { return handler.getSupportedResourceReferences().contains(resourceType); } }
MainResourceReferenceHandlerManager extends AbstractResourceReferenceHandlerManager<ResourceType> { @Override protected boolean matches(ResourceReferenceHandler handler, ResourceType resourceType) { return handler.getSupportedResourceReferences().contains(resourceType); }  }
MainResourceReferenceHandlerManager extends AbstractResourceReferenceHandlerManager<ResourceType> { @Override protected boolean matches(ResourceReferenceHandler handler, ResourceType resourceType) { return handler.getSupportedResourceReferences().contains(resourceType); }   }
MainResourceReferenceHandlerManager extends AbstractResourceReferenceHandlerManager<ResourceType> { @Override protected boolean matches(ResourceReferenceHandler handler, ResourceType resourceType) { return handler.getSupportedResourceReferences().contains(resourceType); }    }