List submatches = first.match(l.getFirst()); if (submatches == null) { return false;
if (!isEmpty()) { List submatches = first.match(l.getFirst()); if (submatches == null) { return false; }  list.addAll(submatches);  submatches = next.match(l.getNext());  if (submatches == null) { return false; }  list.addAll(submatches); return true;
  protected boolean match(ATerm pattern, List list) {    if (pattern.getType() == LIST) {      ATermList l = (ATermList) pattern;        /*      if (this == PureFactory.empty) {        return l == PureFactory.empty;      }      if (l == PureFactory.empty) {        return false;      }        */      if (l == PureFactory.empty) {        return this == PureFactory.empty;      }            if (l.getFirst().getType() == PLACEHOLDER) {        ATerm ph_type = ((ATermPlaceholder) l.getFirst()).getPlaceholder();        if (ph_type.getType() == APPL) {          ATermAppl appl = (ATermAppl) ph_type;          if (appl.getName().equals("list") && appl.getArguments().isEmpty()) {              //if(this != PureFactory.empty) {              list.add(this);                //}            return true;          }        }      }      List submatches = first.match(l.getFirst());      if (submatches == null) {        return false;      }      list.addAll(submatches);      submatches = next.match(l.getNext());      if (submatches == null) {        return false;      }      list.addAll(submatches);      return true;    }    return super.match(pattern, list);  }