private void validate(ListenerSupport.Listeners listeners, HollowProducer.ReadState readState) { Status.StageWithStateBuilder psb = listeners.fireValidationStart(readState); ValidationStatus status = null; try { // Stream over the concatenation of the old and new validators List<ValidationResult> results = listeners.getListeners(ValidatorListener.class) .map(v -> { try { return v.onValidate(readState); } catch (RuntimeException e) { return ValidationResult.from(v).error(e); } }) .collect(toList()); status = new ValidationStatus(results); if (!status.passed()) { ValidationStatusException e = new ValidationStatusException( status, "One or more validations failed. Please check individual failures."); psb.fail(e); throw e; } psb.success(); } finally { listeners.fireValidationComplete(psb, status); } }