Here you can find the source of subSet(Set
public static <T> Set<T> subSet(Set<T> nn, T n)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { public static <T> Set<T> subSet(Set<T> nn, T n) { Set<T> result = new HashSet<T>(nn); result.remove(n);//from www . ja v a2s .c o m return result; } }