code: public E getById(String id) {
          if (id == null) {
              for (E element : this) {
                  if (element != null && element.getId() == null) {
                      return element;
                  }
              }
          } else {
              for (E element : this) {
                  if (element != null && id.equals(element.getId())) {
                      return element;
                  }
              }
          }
          return null;
      }
docs: Returns the first element in this list with a matching identifier
  
  @param id the identifier to search for
  @return the first element in this list with a matching identifier, or null of no such element is found