class Lists {

  public static <E> List<E> concat(List<E> left, List<E> right) {
    int leftSize = left.size();
    if (leftSize == 0) return right;
    int rightSize = right.size();
    if (rightSize == 0) return left;

    // We have to concat. Use Arrays.asList instead of ArrayList as it is simpler due to fixed size
    E[] array = (E[]) new Object[leftSize + rightSize];
    int i = 0;
    for (int l = 0; l < leftSize; l++) {
      array[i++] = left.get(l);
    }
    for (int r = 0; r < rightSize; r++) {
      array[i++] = right.get(r);
    }
    return Collections.unmodifiableList(Arrays.asList(array));
  }

    Lists();

}