@Test public void should_reportFulfilled_ifAllRequirements_wereMet() { final RequirementsChecker checker = new RequirementsChecker(Arrays.asList( new FulfilledRequirement(), new FulfilledRequirement(), new FulfilledRequirement() )); assertThat(checker.checkRequirements().isFulfilled()).isTrue(); }
RequirementsReport checkRequirements() { boolean result = true; List<RequirementReport> requirementsReports = new ArrayList<>(mRequirements.size()); for (Requirement requirement : mRequirements) { RequirementReport report = requirement.check(); result = result && report.isFulfilled(); requirementsReports.add(report); } return new RequirementsReport(result, requirementsReports); }
RequirementsChecker { RequirementsReport checkRequirements() { boolean result = true; List<RequirementReport> requirementsReports = new ArrayList<>(mRequirements.size()); for (Requirement requirement : mRequirements) { RequirementReport report = requirement.check(); result = result && report.isFulfilled(); requirementsReports.add(report); } return new RequirementsReport(result, requirementsReports); } }
RequirementsChecker { RequirementsReport checkRequirements() { boolean result = true; List<RequirementReport> requirementsReports = new ArrayList<>(mRequirements.size()); for (Requirement requirement : mRequirements) { RequirementReport report = requirement.check(); result = result && report.isFulfilled(); requirementsReports.add(report); } return new RequirementsReport(result, requirementsReports); } RequirementsChecker(@NonNull List<? extends Requirement> requirements); }
RequirementsChecker { RequirementsReport checkRequirements() { boolean result = true; List<RequirementReport> requirementsReports = new ArrayList<>(mRequirements.size()); for (Requirement requirement : mRequirements) { RequirementReport report = requirement.check(); result = result && report.isFulfilled(); requirementsReports.add(report); } return new RequirementsReport(result, requirementsReports); } RequirementsChecker(@NonNull List<? extends Requirement> requirements);  }
RequirementsChecker { RequirementsReport checkRequirements() { boolean result = true; List<RequirementReport> requirementsReports = new ArrayList<>(mRequirements.size()); for (Requirement requirement : mRequirements) { RequirementReport report = requirement.check(); result = result && report.isFulfilled(); requirementsReports.add(report); } return new RequirementsReport(result, requirementsReports); } RequirementsChecker(@NonNull List<? extends Requirement> requirements);   }