### Question:
ResultStoreResource { @SuppressWarnings(Constants.SUPPRESS_WARNINGS_UNCHECKED) protected Set<de.metanome.backend.results_db.Result> getResults(FileInput input) throws EntityStorageException { Set<de.metanome.backend.results_db.Result> results = new HashSet<>(); List<ResultType> types = new ArrayList<>(); List<Execution> all = (List<Execution>) HibernateUtil.queryCriteria(Execution.class); for (Execution execution : all) { if (execution.getInputs().contains(input)) { for (de.metanome.backend.results_db.Result result : execution.getResults()) { if (!types.contains(result.getType())) { results.add(result); types.add(result.getType()); } } } } return results; }  @GET @Path("/count/{type}") @Produces(Constants.APPLICATION_JSON_RESOURCE_PATH) Integer count(@PathParam("type") String type); @GET @Path("/get-from-to/{type}/{sortProperty}/{sortOrder}/{start}/{end}") @Produces(Constants.APPLICATION_JSON_RESOURCE_PATH) @SuppressWarnings(Constants.SUPPRESS_WARNINGS_UNCHECKED) List<RankingResult> getAllFromTo(@PathParam("type") String type,
                                          @PathParam("sortProperty") String sortProperty,
                                          @PathParam("sortOrder") boolean ascending,
                                          @PathParam("start") int start,
                                          @PathParam("end") int end); @POST @Path("/load-execution/{executionId}/{dataIndependent}") void loadExecution(@PathParam("executionId") long id,
                            @PathParam("dataIndependent") boolean dataIndependent); @GET @Path("/load-results/{id}/{dataIndependent}") @Produces(Constants.APPLICATION_JSON_RESOURCE_PATH) List<String> loadResults(@PathParam("id") long id,
                                  @PathParam("dataIndependent") boolean dataIndependent);  }### Answer:
@Test public void testGetResultsForFileInput() throws Exception { HibernateUtil.clear(); FileInput input = new FileInput("file"); input = fileInputResource.store(input); Result expectedResult1 = new Result("result_file_1"); expectedResult1.setType(ResultType.CUCC); Result expectedResult2 = new Result("result_file_2"); expectedResult2.setType(ResultType.CUCC); Result expectedResult3 = new Result("result_file_3"); expectedResult3.setType(ResultType.UCC); Execution execution = new Execution(null); execution.addInput(input); execution.addResult(expectedResult1); execution.addResult(expectedResult2); execution.addResult(expectedResult3); HibernateUtil.store(execution); Set<Result> actualResults = resource.getResults(input); assertTrue(actualResults.size() == 2); assertTrue(actualResults.contains(expectedResult3)); assertTrue(actualResults.contains(expectedResult2)); HibernateUtil.clear(); }