public void printVegetarianMenu() { Iterator<Component> iterator = allComponent.iterator(); while (iterator.hasNext()) { Component component = iterator.next(); try { if (component.isVegetarain()) { component.print(); } } catch (UnsupportedOperationException e) { } } }
public void printMenu() { allComponent.print(); }