public T elementEqualTo(T e) {
    if (e == null) {
      throw new NullPointerException();
    }

    if (this.firstElement.equals(e) || this.secondElement.equals(e)) {
      return e;
    }
    else {
      return null;
    }
  }