private int firstEvenIndexOf(Object elem) {
    if (elem == null) {
      for (int i = 0; i < size(); i = i + 2) {
        if (get(i) == null) {
          return i;
        }
      }
    } else {
      for (int i = 0; i < size(); i = i + 2) {
        if (elem.equals(get(i))) {
          return i;
        }
      }
    }
    return -1;
  }