@Test public void testSetEntityRefsFromEntities() { Entity e1 = mock(Entity.class); when(e1.getReference()).thenReturn("/ref/e1"); Entity e2 = mock(Entity.class); when(e2.getReference()).thenReturn("/ref/e2"); ArrayList<String> refernces = new ArrayList<String>(); setEntityRefsFromEntities(refernces, Arrays.asList(new Entity[] { e1, e2 })); assertTrue(refernces.contains("/ref/e1")); assertTrue(refernces.contains("/ref/e2")); }
public static void setEntityRefsFromEntities(Collection<String> refs, Collection<Entity> entities) { refs.clear(); for (Iterator<Entity> i = entities.iterator(); i.hasNext();) { Entity entity = i.next(); refs.add(entity.getReference()); } }
EntityCollections { public static void setEntityRefsFromEntities(Collection<String> refs, Collection<Entity> entities) { refs.clear(); for (Iterator<Entity> i = entities.iterator(); i.hasNext();) { Entity entity = i.next(); refs.add(entity.getReference()); } } }
EntityCollections { public static void setEntityRefsFromEntities(Collection<String> refs, Collection<Entity> entities) { refs.clear(); for (Iterator<Entity> i = entities.iterator(); i.hasNext();) { Entity entity = i.next(); refs.add(entity.getReference()); } }  }
EntityCollections { public static void setEntityRefsFromEntities(Collection<String> refs, Collection<Entity> entities) { refs.clear(); for (Iterator<Entity> i = entities.iterator(); i.hasNext();) { Entity entity = i.next(); refs.add(entity.getReference()); } }  static boolean isIntersectionEntityRefsToEntities(Collection<String> entityRefs, Collection<Entity> entities); static boolean isContainedEntityRefsToEntities(Collection<String> entityRefs, Collection<Entity> entities); static boolean isEqualEntityRefsToEntities(Collection<String> entityRefs, Collection<Entity> entities); static boolean entityCollectionContainsRefString(Collection<Entity> entities, String entityRef); static boolean refCollectionContainsEntity(Collection<String> refs, Entity entity); static void setEntityRefsFromEntities(Collection<String> refs, Collection<Entity> entities); static void computeAddedRemovedEntityRefsFromNewEntitiesOldRefs(Collection<String> addedEntities, Collection<String> removedEntities,
			Collection<Entity> newEntities, Collection<String> oldEntityRefs); }
EntityCollections { public static void setEntityRefsFromEntities(Collection<String> refs, Collection<Entity> entities) { refs.clear(); for (Iterator<Entity> i = entities.iterator(); i.hasNext();) { Entity entity = i.next(); refs.add(entity.getReference()); } }  static boolean isIntersectionEntityRefsToEntities(Collection<String> entityRefs, Collection<Entity> entities); static boolean isContainedEntityRefsToEntities(Collection<String> entityRefs, Collection<Entity> entities); static boolean isEqualEntityRefsToEntities(Collection<String> entityRefs, Collection<Entity> entities); static boolean entityCollectionContainsRefString(Collection<Entity> entities, String entityRef); static boolean refCollectionContainsEntity(Collection<String> refs, Entity entity); static void setEntityRefsFromEntities(Collection<String> refs, Collection<Entity> entities); static void computeAddedRemovedEntityRefsFromNewEntitiesOldRefs(Collection<String> addedEntities, Collection<String> removedEntities,
			Collection<Entity> newEntities, Collection<String> oldEntityRefs);  }