code: public static <T> T getItemAtPositionOrNull(Collection<T> collection, int position) {
          if (position >= collection.size()) {
              return null;
          }
          if (collection instanceof List) {
              return ((List<T>) collection).get(position);
          }
          Iterator<T> iterator = collection.iterator();
          T item = null;
          for (int i = 0; i < position + 1; i++) {
              item = iterator.next();
          }
          return item;
      }
docs: Returns the n-th item or {@code null} if collection is smaller.
  
  @param collection the given collection
  @param position   position of the wanted item
  @return the item on position or {@code null} if the given collection is too small
  @throws NullPointerException if collection is {@code null}