Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.util.ArrayList;

import java.util.List;

public class Main {

    public static <T> List<T> addAll(List<T> listeDestination, List<T> listeAInserer) {
        if (listeDestination == null && listeAInserer == null) {
            return new ArrayList<T>();
        }
        if (listeDestination == null && listeAInserer != null) {
            return new ArrayList<T>(listeAInserer);
        }
        if (listeDestination != null && listeAInserer == null) {
            return new ArrayList<T>(listeDestination);
        }
        final List<T> listeRetour = new ArrayList<T>(listeDestination);
        listeRetour.addAll(listeAInserer);
        return listeRetour;
    }
}