code: public List<T> first(final int n) {
          N.checkArgument(n >= 0, "'n' can't be negative: " + n);
  
          if (N.isNullOrEmpty(coll) || n == 0) {
              return new ArrayList<>();
          } else if (coll.size() <= n) {
              return new ArrayList<>(coll);
          } else if (coll instanceof List) {
              return new ArrayList<>(((List<T>) coll).subList(0, n));
          } else {
              final List<T> result = new ArrayList<>(N.min(n, coll.size()));
              int cnt = 0;
  
              for (T e : coll) {
                  result.add(e);
  
                  if (++cnt == n) {
                      break;
                  }
              }
  
              return result;
          }
      }
docs: Return at most first <code>n</code> elements.
  
  @param n
  @return