private static ApprovalFailureReporter tryFor( ApprovalFailureReporter returned, Class<? extends ApprovalFailureReporter> trying) { if (returned == null && trying != null) { return ClassUtils.create(trying); } return returned; }
private static ApprovalFailureReporter getReporter(UseReporter reporter) { Class<? extends ApprovalFailureReporter>[] classes = reporter.value(); List<ApprovalFailureReporter> reporters = new ArrayList<ApprovalFailureReporter>(); for (Class<? extends ApprovalFailureReporter> clazz : classes) { ApprovalFailureReporter instance = ClassUtils.create(clazz); reporters.add(instance); } return reporters.size() == 1 ? reporters.get(0) : new MultiReporter(reporters); }