All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.xpertss.proximo.util.Lists Maven / Gradle / Ivy

Go to download

Proximo provides a simple declarative means for creating proxies and stubbing method behavior overrides.

The newest version!
/**
 * Copyright 2015 XpertSoftware
 * 

* Created By: cfloersch * Date: 6/10/2015 */ package org.xpertss.proximo.util; import java.util.ArrayList; import java.util.List; public class Lists { public static List tail(List source, int start) { if(start >= source.size()) throw new IllegalArgumentException("invalid start index"); List list = new ArrayList<>(); for(int i = start; i < source.size(); i++) { list.add(source.get(i)); } return list; } public static List subList(List source, int start, int end) { if(end - start < 0) throw new IllegalArgumentException("start after end"); List list = new ArrayList<>(end - start); for(int i = start; i < end; i++) { list.add(source.get(i)); } return list; } public static List join(Iterable... iterables) { List list = new ArrayList<>(); for(Iterable iterable : iterables) { for(T item : iterable) list.add(item); } return list; } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy