public static <T> List<T> truncate(List<T> list, int maxSize) {
        requireNonNull(list, "list");
        checkArgument(maxSize >= 0, "maxSize: %s (expected: >= 0)", maxSize);

        if (list.size() <= maxSize) {
            return list;
        }
        return list.subList(0, maxSize);
    }
Returns a truncated list of at most {@code maxSize}.
core/src/main/java/com/linecorp/armeria/internal/common/util/CollectionUtil.java