Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.List;

public class Main {
    public static <T> List<? super T> limit(List<? super T> source, int size) {
        if ((source.size() == size) || (source.size() < size)) {
            return source;
        } else {
            return source.subList(0, size);
        }
    }
}