Check out example codes for "TreeSet tailSet() method in java". It will help you in understanding the concepts better.

Code Example 1

import java.util.Iterator;
import java.util.TreeSet;
public class TreeSetTailSetFromElementMethod
{
   public static void main(String[] args)
   {
      TreeSet<Integer> ts = new TreeSet<Integer>();
      TreeSet<Integer> inclusive = new TreeSet<Integer>();
      ts.add(12);
      ts.add(22);
      ts.add(32);
      ts.add(42);
      ts.add(52);
      ts.add(62);
      ts.add(72);
      ts.add(82);
      // create tailSet
      inclusive = (TreeSet)ts.tailSet(52, true);
      // create iterator
      Iterator<Integer> iterate = inclusive.iterator();
      System.out.println("TreeSet tailSet: ");
      while(iterate.hasNext())
      {
         System.out.println(iterate.next() + " ");
      }
   }
}

Learn ReactJs, React Native from akashmittal.com