Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import java.util.Collections;
import java.util.Comparator;

public class Main {
    public static <T> void sort(java.util.List<T> list, Comparator<? super T> comparator) {
        if (list == null || list.size() < 2) {
            return; // nothing to sort if null / empty / 1 element
        }
        Collections.sort(list, comparator);
    }
}