ProtocolFactory { public static TopicPathBuilder newTopicPathBuilderFromNamespace(final String namespace) { return ImmutableTopicPathBuilder.of(namespace, TopicPath.ID_PLACEHOLDER).things(); } private  ProtocolFactory(); static AdaptableBuilder newAdaptableBuilder(final TopicPath topicPath); static AdaptableBuilder newAdaptableBuilder(final Adaptable existingAdaptable); @Deprecated static AdaptableBuilder newAdaptableBuilder(final Adaptable existingAdaptable,
            final TopicPath overwriteTopicPath); static Adaptable setExtra(final Adaptable existingAdaptable, final JsonObject extra); static TopicPath emptyTopicPath(); @SuppressWarnings({"squid:S1166"}) static TopicPath newTopicPath(final String path); @Deprecated static TopicPathBuilder newTopicPathBuilder(final String thingId); static TopicPathBuilder newTopicPathBuilder(final ThingId thingId); static TopicPathBuilder newTopicPathBuilder(final NamespacedEntityId entityId); static TopicPathBuilder newTopicPathBuilder(final PolicyId policyId); static TopicPathBuilder newTopicPathBuilderFromNamespace(final String namespace); static Payload newPayload(final String jsonString); static Payload newPayload(final JsonObject jsonObject); static PayloadBuilder newPayloadBuilder(); static PayloadBuilder newPayloadBuilder(@Nullable final JsonPointer path); static DittoHeaders emptyHeaders(); static DittoHeaders newHeadersWithDittoContentType(final Map<String, String> headers); static DittoHeaders newHeaders(final Collection<Map.Entry<String, String>> headers); static DittoHeaders newHeaders(final JsonObject headersAsJson); static JsonifiableAdaptable wrapAsJsonifiableAdaptable(final Adaptable adaptable); static JsonifiableAdaptable jsonifiableAdaptableFromJson(final JsonObject adaptableAsJson);  }
@Test public void testNewTopicPathBuilderFromNamespace() { final TopicPathBuilder topicPathBuilder = ProtocolFactory.newTopicPathBuilderFromNamespace(NAMESPACE); final TopicPath topicPath = topicPathBuilder.twin().commands().modify().build(); assertThat(topicPath.getNamespace()).isEqualTo(NAMESPACE); assertThat(topicPath.getId()).isEqualTo(TopicPath.ID_PLACEHOLDER); assertThat(topicPath.getChannel()).isEqualTo(TopicPath.Channel.TWIN); assertThat(topicPath.getGroup()).isEqualTo(TopicPath.Group.THINGS); assertThat(topicPath.getCriterion()).isEqualTo(TopicPath.Criterion.COMMANDS); assertThat(topicPath.getAction()).contains(TopicPath.Action.MODIFY); }