Пример #1
0
  public void printVegetarianMenu() {
    Iterator<Component> iterator = allComponent.iterator();

    while (iterator.hasNext()) {
      Component component = iterator.next();

      try {
        if (component.isVegetarain()) {
          component.print();
        }
      } catch (UnsupportedOperationException e) {
      }
    }
  }
Пример #2
0
 public void printMenu() {
   allComponent.print();
 }