@Test public void testMap() { LOG.info("Map"); FieldProcessor<Map> instance = new FieldProcessor(Map.class); TestClassE item1 = new TestClassE("10"); TestClassE item2 = new TestClassE("20"); Map<String, TestClassE> map = new HashMap<>(); for (TestClassE item : Arrays.asList(item1, item2)) { map.put(item.getId(), item); } instance.processLinks(map, mockUriInfo, mockRmc, mockRlcc); assertEquals("widgets/10", map.get("10").link); assertEquals("widgets/20", map.get("20").link); }
void processLinks(T entity, UriInfo uriInfo, ResourceMappingContext rmc, ResourceLinkContributionContext rlcc) { Set<Object> processed = new HashSet<Object>(); Object resource = uriInfo.getMatchedResources().get(0); processLinks(entity, resource, entity, processed, uriInfo, rmc, rlcc); }
FieldProcessor { void processLinks(T entity, UriInfo uriInfo, ResourceMappingContext rmc, ResourceLinkContributionContext rlcc) { Set<Object> processed = new HashSet<Object>(); Object resource = uriInfo.getMatchedResources().get(0); processLinks(entity, resource, entity, processed, uriInfo, rmc, rlcc); } }
FieldProcessor { void processLinks(T entity, UriInfo uriInfo, ResourceMappingContext rmc, ResourceLinkContributionContext rlcc) { Set<Object> processed = new HashSet<Object>(); Object resource = uriInfo.getMatchedResources().get(0); processLinks(entity, resource, entity, processed, uriInfo, rmc, rlcc); } FieldProcessor(Class<T> c); }
FieldProcessor { void processLinks(T entity, UriInfo uriInfo, ResourceMappingContext rmc, ResourceLinkContributionContext rlcc) { Set<Object> processed = new HashSet<Object>(); Object resource = uriInfo.getMatchedResources().get(0); processLinks(entity, resource, entity, processed, uriInfo, rmc, rlcc); } FieldProcessor(Class<T> c);  }
FieldProcessor { void processLinks(T entity, UriInfo uriInfo, ResourceMappingContext rmc, ResourceLinkContributionContext rlcc) { Set<Object> processed = new HashSet<Object>(); Object resource = uriInfo.getMatchedResources().get(0); processLinks(entity, resource, entity, processed, uriInfo, rmc, rlcc); } FieldProcessor(Class<T> c);   }