kz.greetgo.scheduling.util.ListUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of greetgo.scheduling Show documentation
Show all versions of greetgo.scheduling Show documentation
Scheduler using in greetgo!
The newest version!
package kz.greetgo.scheduling.util;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class ListUtil {
public static List concatLists(List list1, List list2) {
int size1 = list1.size();
int size2 = list2.size();
if (size1 == 0) {
if (size2 == 0) {
return Collections.emptyList();
}
return list2;
}
if (size2 == 0) {
return list1;
}
{
List ret = new ArrayList<>(size1 + size2);
ret.addAll(list1);
ret.addAll(list2);
return ret;
}
}
}