class Hayes implements Modem {

  /**
   * Accepts all visitors but honors only HayesVisitor.
   */
  @Override
  public void accept(ModemVisitor modemVisitor) {<FILL_FUNCTION_BODY>}

  /**
   * Hayes' modem's toString method.
   */
  @Override
  public String toString() {
    return "Hayes modem";
  }
}

    if (modemVisitor instanceof HayesVisitor) {
      ((HayesVisitor) modemVisitor).visit(this);
    } else {
      LOGGER.info("Only HayesVisitor is allowed to visit Hayes modem");
    }

  
<no_super_class>