@Test public final void findAllProblemReportsWithTheGivenCorrelationId() { List<ProblemReport> reports = findAllProblemReports("T2"); assertNotNull(reports); assertFalse(reports.isEmpty()); assertEquals(2, reports.size()); reports = findAllProblemReports("T1"); assertNotNull(reports); assertFalse(reports.isEmpty()); assertEquals(1, reports.size()); reports = findAllProblemReports("TXYZ"); assertNotNull(reports); assertTrue(reports.isEmpty()); }
public static List<ProblemReport> findAllProblemReports(String correlationId) { List<ProblemReport> result = new ArrayList<>(); for (ProblemReport report : database) { if (report.getCorrelationId().equals(correlationId)) { result.add(report); } } return result; }
ProblemReportDB { public static List<ProblemReport> findAllProblemReports(String correlationId) { List<ProblemReport> result = new ArrayList<>(); for (ProblemReport report : database) { if (report.getCorrelationId().equals(correlationId)) { result.add(report); } } return result; } }
ProblemReportDB { public static List<ProblemReport> findAllProblemReports(String correlationId) { List<ProblemReport> result = new ArrayList<>(); for (ProblemReport report : database) { if (report.getCorrelationId().equals(correlationId)) { result.add(report); } } return result; }  }
ProblemReportDB { public static List<ProblemReport> findAllProblemReports(String correlationId) { List<ProblemReport> result = new ArrayList<>(); for (ProblemReport report : database) { if (report.getCorrelationId().equals(correlationId)) { result.add(report); } } return result; }  static ProblemReport findProblemReport(String reportNumber); static List<ProblemReport> getAllProblemReports(); static List<ProblemReport> getFavoriteProblemReports(); static List<ProblemReport> findAllProblemReports(String correlationId); static void deleteProblemReport(String reportNumber); }
ProblemReportDB { public static List<ProblemReport> findAllProblemReports(String correlationId) { List<ProblemReport> result = new ArrayList<>(); for (ProblemReport report : database) { if (report.getCorrelationId().equals(correlationId)) { result.add(report); } } return result; }  static ProblemReport findProblemReport(String reportNumber); static List<ProblemReport> getAllProblemReports(); static List<ProblemReport> getFavoriteProblemReports(); static List<ProblemReport> findAllProblemReports(String correlationId); static void deleteProblemReport(String reportNumber);  }