import common.Product; import common.Supplier; import java.util.HashSet; import java.util.Iterator; import java.util.Set; public class ProductCatalogue implements Iterable { private final Set products = new HashSet<>(); public void addSupplier(final Supplier supplier) { products.addAll(supplier.getProducts()); } @Override public Iterator iterator() { return products.iterator(); } }