class OnlyDefPrefixNoViolationPredicate implements ViolationPredicate {

    @Override
    public Optional<Boolean> apply(Overlap overlap) {
        Set<Edge> missingDirectConnectionEdges = overlap.getMissingEdges().stream()
                .filter(Edge::isDirect)
                .filter(edge -> connectsToMappedNode(edge, overlap))
                .collect(Collectors.toSet());

        if (allHaveMappedSourceAndMissingTarget(missingDirectConnectionEdges, overlap)) {
            Set<Node> missingEdgeSources = getSources(missingDirectConnectionEdges);
            if (isSingleDataNode(missingEdgeSources) || isProducerDataPair(missingEdgeSources, overlap)) {
                return Optional.of(false);
            }
        }

        return Optional.empty();
    }

}