@Contract(pure = true)
  public static @NotNull <T> List<T> getFirstItems(@NotNull List<T> items, int maxItems) {
    if (maxItems < 0) {
      throw new IllegalArgumentException("Expected non-negative maxItems; got: "+maxItems);
    }
    return maxItems >= items.size() ? items : items.subList(0, maxItems);
  }
@Contract(pure = true)
  public static @NotNull <T> List<T> getFirstItems(@NotNull List<T> items, int maxItems)