public boolean closes(TokenShow other) {
    if (selfClosing)
      return false;
    if (names==null)
      return true;
    List<String> otherNames=other.getNames();
    boolean noMatch=
       (names!=null && otherNames==null) ||
       (names.size()!=otherNames.size());
    if (noMatch)
      return false;
    for (int i=0; i<names.size(); i++)
      if (!names.get(i).equals(otherNames.get(i)))
        return false;
    return true;
  }