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

kz.greetgo.scheduling.util.ListUtil Maven / Gradle / Ivy

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;
    }

  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy