class BPMNValidatorImpl implements BPMNValidator {

    @Override
    public void validate(Diagram diagram, Consumer<Collection<DomainViolation>> resultConsumer) {
        String rawContent = diagramService.getRawContent(diagram);
        if (Objects.nonNull(rawContent)) {
            resultConsumer.accept(validate(rawContent, diagram.getMetadata().getTitle()).stream().collect(Collectors.toSet()));
            return;
        }

        resultConsumer.accept(Collections.emptyList());
    }

      BPMNValidatorImpl();
    @Inject public  BPMNValidatorImpl(final @Default DiagramService diagramService);

}