/** * Iterates over all known {@link GraphItem}s and asks for their {@link * GraphItem#getCapability(CapabilityName) capability} to support <code>name</code>. * * @param name the capability to search * @return all the available capabilities */ public <T> List<T> getCapabilities(CapabilityName<T> name) { if (graph == null) { return Collections.emptyList(); } List<T> result = new ArrayList<>(); for (GraphItem item : graph.getItems()) { T capability = item.getCapability(name); if (capability != null) { result.add(capability); } } return result; }