default Optional<NotificationDefinition> findNotification(final QName qname) {
// 'notification' identifier must never collide with another element, hence if we look it up and it ends up
// being an NotificationDefinition, we have found a match.
- return get(SchemaTreeNamespace.class, qname)
- .flatMap(child -> child instanceof NotificationDefinition ? Optional.of((NotificationDefinition) child)
+ return findSchemaTreeNode(qname)
+ .flatMap(child -> child instanceof NotificationDefinition notification ? Optional.of(notification)
: Optional.empty());
}
}