### Question:
ResultCounter extends ResultReceiver { @Override public void close() throws IOException { for (Map.Entry<ResultType, Integer> entry : resultCounts.entrySet()) { ResultType type = entry.getKey(); Integer count = entry.getValue(); write(type.getEnding(), type.getName(), count); } } ResultCounter(String algorithmExecutionIdentifier);  ResultCounter(String algorithmExecutionIdentifier, Boolean test); @Override void receiveResult(BasicStatistic statistic); @Override void receiveResult(ConditionalUniqueColumnCombination conditionalUniqueColumnCombination); @Override void receiveResult(FunctionalDependency functionalDependency); @Override void receiveResult(ConditionalInclusionDependency conditionalInclusionDependency); @Override void receiveResult(MatchingDependency matchingDependency); @Override void receiveResult(ConditionalFunctionalDependency conditionalFunctionalDependency); @Override void receiveResult(MultivaluedDependency multivaluedDependency); @Override void receiveResult(InclusionDependency inclusionDependency); @Override void receiveResult(OrderDependency orderDependency); @Override void receiveResult(UniqueColumnCombination uniqueColumnCombination); @Override void receiveResult(DenialConstraint denialConstraint); @Override void close(); EnumMap<ResultType, Integer> getResults(); static final String HEADER; }### Answer:
@Test public void testClose() throws IOException, CouldNotReceiveResultException { ResultCounter resultCounter = new ResultCounter("identifier"); resultCounter.setResultTestDir(); resultCounter.receiveResult(mock(UniqueColumnCombination.class)); resultCounter.close(); File actualFile = new File(resultCounter.getOutputFilePathPrefix() + ResultType.UCC.getEnding()); assertTrue(actualFile.exists()); String fileContent = Files.toString(actualFile, Charsets.UTF_8); assertTrue(fileContent.contains("Unique Column Combination: 1")); FileUtils.deleteDirectory(new File(ResultPrinter.RESULT_TEST_DIR).getParentFile()); }