public ComponentInstanceGroup<T> ofType(String typeName) { final ComponentInstanceGroup<T> selected = new ComponentInstanceGroup<T>(); for (T instance: this) { if (instance.getType().isNamed(typeName)) { selected.add(instance); } } return selected; }
@Override public boolean equals(Object that) { if (that == null) { return false; } if (that instanceof Component) { Component other = (Component) that; if (other.getOwner().isDefined() && getOwner().isDefined()) { return other.getOwner().get().equals(getOwner().get()) && other.isNamed(getName()); } } return false; }