### Question:
FunAlgorithm { protected LinkedList<FunQuadruple> generateCandidates(List<FunQuadruple> lk) { LinkedList<FunQuadruple> lkPlus1 = new LinkedList<>(); if (lk.isEmpty()) { return lkPlus1; } Set<ColumnCombinationBitset> subsets = new HashSet<>(); int k = lk.get(0).candidate.size(); ColumnCombinationBitset union = new ColumnCombinationBitset(); for (FunQuadruple subsetQuadruple : lk) { if (subsetQuadruple.count == 0) { continue; } union = subsetQuadruple.candidate.union(union); subsets.add(subsetQuadruple.candidate); } Map<ColumnCombinationBitset, Integer> candidateGenerationCount = new HashMap<>(); List<ColumnCombinationBitset> lkPlus1Candidates; FunQuadruple lkPlus1Member; for (ColumnCombinationBitset subset : subsets) { lkPlus1Candidates = union.getNSubsetColumnCombinationsSupersetOf( subset, k + 1); for (ColumnCombinationBitset candidate : lkPlus1Candidates) { if (candidateGenerationCount.containsKey(candidate)) { int count = candidateGenerationCount.get(candidate); count++; candidateGenerationCount.put(candidate, count); } else { candidateGenerationCount.put(candidate, 1); } } } for (ColumnCombinationBitset candidate : candidateGenerationCount .keySet()) { if (candidateGenerationCount.get(candidate) == (k + 1)) { lkPlus1Member = new FunQuadruple(candidate, addPliGenerate( candidate).getRawKeyError()); lkPlus1.add(lkPlus1Member); } } return lkPlus1; } FunAlgorithm(String relationName, List<String> columnNames,
                        FunctionalDependencyResultReceiver fdReceiver);  FunAlgorithm(String relationName, List<String> columnNames,
                        FunctionalDependencyResultReceiver fdReceiver,
                        UniqueColumnCombinationResultReceiver uccReceiver); void run(List<PositionListIndex> pliList);  }### Answer:
@Test public void testGenerateCandidate() { FixtureCandidateGeneration fixture = new FixtureCandidateGeneration(); List<FunQuadruple> l2 = fixture.getL2(); FunAlgorithm fun = fixture.getFunAlgorithmMockedAddPliGenerate(); assertThat(fun.generateCandidates(l2), IsIterableContainingInAnyOrder.containsInAnyOrder(fixture.getExpectedL3Array())); assertThat(l2, IsIterableContainingInAnyOrder.containsInAnyOrder(fixture.getExpectedL2Array())); }