package jcf_set.example;

import java.util.TreeSet;

public class TreeSetExample2 {
	
	public static void main(String[] Args) {
		new TreeSetExample2().run();
	}
	
	public void run() {
		
		// Tree1
		TreeSet<String> tree1 = new TreeSet<String>();
		
		tree1.add("yes");
		tree1.add("no");
		tree1.add("maybe");
		tree1.add("always");
		tree1.add("no");
		
		System.out.println("Stampa del TreeSet1: ");
		System.out.println(tree1);
		
		// Tree2
		TreeSet<String> tree2 = new TreeSet<String>(tree1);
		
		System.out.println("Stampa del TreeSet2: ");
		System.out.println(tree2);
		
		// Tree3
		TreeSet<String> tree3 = new TreeSet<String>(new Decreasing());
		tree3.addAll(tree2);
		
		System.out.println("Stampa del TreeSet3: ");
		System.out.println(tree3);
		
	}
	
}
