### Question:
Apriori { static <T> Set<Set<T>> kMinusOneSubsets(Set<T> c) { Set<Set<T>> kMinusOneSubsets = new HashSet<>(); for (T i : c) { Set<T> subset = new HashSet<T>(c); subset.remove(i); kMinusOneSubsets.add(subset); } return kMinusOneSubsets; } private  Apriori(); static Map<Set<T>, Double> extractItemsets(Collection<Set<T>> data, double minSupport); static Ruleset<T> buildRules(Collection<Set<T>> data, double minSupport, double minConfidence);  }### Answer:
@Test public void testKMinusOneSubsets() { Set<Integer> s = newHashSet(1, 2, 3, 4); Set<Set<Integer>> subsets = Apriori.kMinusOneSubsets(s); assertEquals(4, subsets.size()); assertTrue(subsets.contains(newHashSet(2, 3, 4))); assertTrue(subsets.contains(newHashSet(1, 3, 4))); assertTrue(subsets.contains(newHashSet(1, 2, 4))); assertTrue(subsets.contains(newHashSet(2, 3, 4))); }