public static <E extends Comparable <E>> void subsets(E[] array) {
		if (array == null)
			return;
		
		HeapSort.sort(array);

		for (int i = 0; i < array.length - 2; i++) {
			
			if (array[i] != array[i + 1]) {
				for (int j = i + 1; j < array.length - 1; j++) {
					
					if (array[j] != array[j + 1]) {
						for (int k = j + 1; k < array.length; k++) {
							
							if (k == array.length - 1 || array[k] != array[k + 1])
								System.out.println(array[i] + " " + array[j] + " " + array[k]);
						}
					}
				}
			}
		}
	}