public static Set<int[]> getSubsets(int[] set, int sum) {
		Map<String, int[]> map = new LinkedHashMap<String, int[]>();
		Set<int[]> subsets = new LinkedHashSet<int[]>();
		int[] subset;
		for (int i = 0; i < set.length; i++) {
			for (int j = 0; j < set.length; j++) {
				for (int k = 0; k < set.length; k++) {
					if ((i != j && j != k && i != k) && (set[i] + set[j] + set[k] == sum)) {
						subset = new int[]{set[i], set[j], set[k]};
						Arrays.sort(subset);
						String key = "";
						for (int m = 0; m < 3; m++) {
							key += subset[m] + "-";
						}
						map.put(key, subset);
					}
				}
			}
		}
		for (String key : map.keySet()) {
			subsets.add(map.get(key));
		}
		
		return subsets;
	}