Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
/**
 * Aptana Studio
 * Copyright (c) 2005-2011 by Appcelerator, Inc. All Rights Reserved.
 * Licensed under the terms of the GNU Public License (GPL) v3 (with exceptions).
 * Please see the license.html included with this distribution for details.
 * Any modifications to this file must keep this entire header intact.
 */

import java.util.Collections;

import java.util.Set;

public class Main {
    /**
     * This is a convenience method that essentially checks for a null set and returns Collections.emptySet in that
     * case. If the set is non-null, then this is an identity function.
     * 
     * @param <T>
     * @param set
     * @return
     */
    public static <T> Set<T> getSetValue(Set<T> set) {
        if (set == null) {
            return Collections.emptySet();
        }

        return set;
    }
}