docs: public static Object getElementFromCollection(Collection<Object> collection, int index) {
      if (collection.size() < index + 1)
        return null;
  
      if (collection instanceof List)
        return ((List<Object>) collection).get(index);
  
      Iterator<Object> iterator = collection.iterator();
      for (int i = 0; i < index; i++) {
        iterator.next();
      }
      return iterator.next();
    }