public List<T> getSubList(int maxSubListSize) {
        List<T> subList = newArrayList();
        int counter = 0;
        for (T t : getList()) {
            if (counter++ < maxSubListSize) {
                subList.add(t);
            } else {
                break;
            }
        }
        return subList;
    }
public List < T > getSubList ( int maxSubListSize ) { List < T > subList = newArrayList ( ) ; int counter = 0 ; for ( T t : getList ( ) ) { if ( counter ++ < maxSubListSize ) { subList . add ( t ) ; } else { break ; } } return subList ; }
Returns at most the first maxSubListSize elements of this list.