UnknownTopicPathException extends DittoRuntimeException { static UnknownTopicPathException fromTopicAndPath( @Nullable final TopicPath topicPath, @Nullable final MessagePath path, @Nonnull final DittoHeaders dittoHeaders) { final String theTopicPath = null != topicPath ? topicPath.getPath() : ""; final String message = MessageFormat.format(MESSAGE_TEMPLATE_WITH_PATH, theTopicPath, path); return new Builder() .dittoHeaders(dittoHeaders) .message(message) .build(); } private  UnknownTopicPathException(final DittoHeaders dittoHeaders,
            @Nullable final String message,
            @Nullable final String description,
            @Nullable final Throwable cause,
            @Nullable final URI href); static Builder newBuilder(final TopicPath topicPath); static Builder newBuilder(final String path); static UnknownTopicPathException fromMessage(@Nullable final String message,
            final DittoHeaders dittoHeaders); static UnknownTopicPathException fromJson(final JsonObject jsonObject, final DittoHeaders dittoHeaders); static final String ERROR_CODE; }
@Test public void fromTopicAndPath() { final TopicPath topicPath = ImmutableTopicPath.of("ns", "id", TopicPath.Group.THINGS, TopicPath.Channel.TWIN, TopicPath.Criterion.COMMANDS, TopicPath.Action.MODIFY); final MessagePath messagePath = ImmutableMessagePath.of(JsonPointer.of("/policyId")); final DittoHeaders dittoHeaders = DittoHeaders.empty(); final UnknownTopicPathException exception = UnknownTopicPathException.fromTopicAndPath(topicPath, messagePath, dittoHeaders); Assertions.assertThat(exception) .hasMessageContaining(topicPath.getPath()) .hasMessageContaining(messagePath.toString()); }