@Test public void filterCommunications() { Set<Task> tasks = new HashSet<Task>(); Communication c = new Communication("c"); Task task = new Task("t"); tasks.add(task); tasks.add(c); boolean visited = false; for (Task t : Models.filterCommunications(tasks)) { Assert.assertFalse(visited); Assert.assertEquals(c, t); Assert.assertNotEquals(task, t); visited = true; } Assert.assertTrue(visited); }
public static Iterable<Task> filterCommunications(final Iterable<Task> iterable) { return new Iterable<Task>() { @Override public Iterator<Task> iterator() { return new OnlyCommunicationIterator(iterable.iterator()); } }; }
Models { public static Iterable<Task> filterCommunications(final Iterable<Task> iterable) { return new Iterable<Task>() { @Override public Iterator<Task> iterator() { return new OnlyCommunicationIterator(iterable.iterator()); } }; } }
Models { public static Iterable<Task> filterCommunications(final Iterable<Task> iterable) { return new Iterable<Task>() { @Override public Iterator<Task> iterator() { return new OnlyCommunicationIterator(iterable.iterator()); } }; }  }
Models { public static Iterable<Task> filterCommunications(final Iterable<Task> iterable) { return new Iterable<Task>() { @Override public Iterator<Task> iterator() { return new OnlyCommunicationIterator(iterable.iterator()); } }; }  static Iterable<Task> filterCommunications(final Iterable<Task> iterable); static Iterable<Task> filterProcesses(final Iterable<Task> iterable); static boolean isProcess(Task task); static boolean isCommunication(Task task); static List<DirectedLink> getOutLinks(Architecture<Resource, Link> architecture, Resource r0); static List<DirectedLink> getInLinks(Architecture<Resource, Link> architecture, Resource r0); static List<DirectedLink> getLinks(Architecture<Resource, Link> architecture); static List<DirectedLink> getLinks(Architecture<Resource, Link> architecture, Link link); static Map<String, Element> getElementsMap(Specification specification); static Set<Element> getElements(Specification specification); static Iterable<E> filterType(final Iterable<E> iterable, final String... types); static Specification copy(Specification specification); static Routings<Task, Resource, Link> copyRoutings(Application<Task, Dependency> sApplication,
			Routings<Task, Resource, Link> sRoutings, Application<Task, Dependency> iApplication,
			Architecture<Resource, Link> iArchitecture); static Mappings<Task, Resource> copyMappings(Mappings<Task, Resource> sMappings,
			Architecture<Resource, Link> iArchitecture, Application<Task, Dependency> iApplication); static Application<Task, Dependency> copy(Application<Task, Dependency> sApplication); static Architecture<Resource, Link> copy(Architecture<Resource, Link> sArchitecture); @SuppressWarnings("unchecked") static E copy(Element element); @SuppressWarnings("unchecked") static M copy(Mapping<?, ?> mapping); static void setAttributes(IAttributes e, Attributes attributes); static Specification clone(Specification specification); static Application<T, D> clone(Application<T, D> sApplication); static Architecture<R, L> clone(Architecture<R, L> sArchitecture); static void filterByResources(Specification specification, Collection<Resource> resources); static void filter(Specification specification, Collection<Function<Task, Dependency>> functions); static void filterByFunctionName(Specification specification, Collection<String> functions); static void filterByFunctionName(Specification specification, String... functions); }
Models { public static Iterable<Task> filterCommunications(final Iterable<Task> iterable) { return new Iterable<Task>() { @Override public Iterator<Task> iterator() { return new OnlyCommunicationIterator(iterable.iterator()); } }; }  static Iterable<Task> filterCommunications(final Iterable<Task> iterable); static Iterable<Task> filterProcesses(final Iterable<Task> iterable); static boolean isProcess(Task task); static boolean isCommunication(Task task); static List<DirectedLink> getOutLinks(Architecture<Resource, Link> architecture, Resource r0); static List<DirectedLink> getInLinks(Architecture<Resource, Link> architecture, Resource r0); static List<DirectedLink> getLinks(Architecture<Resource, Link> architecture); static List<DirectedLink> getLinks(Architecture<Resource, Link> architecture, Link link); static Map<String, Element> getElementsMap(Specification specification); static Set<Element> getElements(Specification specification); static Iterable<E> filterType(final Iterable<E> iterable, final String... types); static Specification copy(Specification specification); static Routings<Task, Resource, Link> copyRoutings(Application<Task, Dependency> sApplication,
			Routings<Task, Resource, Link> sRoutings, Application<Task, Dependency> iApplication,
			Architecture<Resource, Link> iArchitecture); static Mappings<Task, Resource> copyMappings(Mappings<Task, Resource> sMappings,
			Architecture<Resource, Link> iArchitecture, Application<Task, Dependency> iApplication); static Application<Task, Dependency> copy(Application<Task, Dependency> sApplication); static Architecture<Resource, Link> copy(Architecture<Resource, Link> sArchitecture); @SuppressWarnings("unchecked") static E copy(Element element); @SuppressWarnings("unchecked") static M copy(Mapping<?, ?> mapping); static void setAttributes(IAttributes e, Attributes attributes); static Specification clone(Specification specification); static Application<T, D> clone(Application<T, D> sApplication); static Architecture<R, L> clone(Architecture<R, L> sArchitecture); static void filterByResources(Specification specification, Collection<Resource> resources); static void filter(Specification specification, Collection<Function<Task, Dependency>> functions); static void filterByFunctionName(Specification specification, Collection<String> functions); static void filterByFunctionName(Specification specification, String... functions);  }