class QName {

    public static QName adaptName(final @NotNull NamespaceMapping mapping,
                                  final @NotNull Type type,
                                  final @NotNull Name name) {
        return new QName(type, result1(mapping::getPrefix)
                .apply(name.getNamespaceURI()).toOptional().orElse(null),
                name.getLocalName(), name.getNamespaceURI());
    }

    public  QName(final @NotNull Type type,
                 final @Nullable String prefix,
                 final @NotNull String localName,
                 final @Nullable String uri);

}