Java examples for java.util:Collection Search
checks for a null set and returns Collections.emptySet in that case.
//package com.java2s; import java.util.Collections; import java.util.Set; public class Main { public static <T> Set<T> getSetValue(Set<T> set) { if (set == null) { return Collections.emptySet(); }// w w w.j a v a 2 s . com return set; } }