public CycList allIndicesOf(Object elem) {
    CycList result = new CycList();
    if (elem == null) {
      for (int i = 0; i < size(); i++) {
        if (get(i) == null) {
          result.add(i);
        }
      }
    } else {
      for (int i = 0; i < size(); i++) {
        if (elem.equals(get(i))) {
          result.add(i);
        }
      }
    }
    return result;
  }