class PointToPointValidator {

    void validate(Object subscriber, List<Class<?>> subscribedNotifications) {
        Class<?> subscriberClass = subscriber.getClass();
        subscribedNotifications.stream()
                .filter(PointToPointNotification.class::isAssignableFrom)
                .flatMap(this::streamP2PSupertypes)
                .forEach(classImplementingP2P -> {
                    Class<?> previousSubscriberClass = subscriptions.putIfAbsent(classImplementingP2P, subscriberClass);
                    if (previousSubscriberClass != null) {
                        throw new IllegalStateException(getErrorMessage(subscriberClass, classImplementingP2P, previousSubscriberClass));
                    }
                });
    }

      PointToPointValidator();

}