PropertyBag { public static PropertyBag fromTopic(final String topic) { Objects.requireNonNull(topic); final int index = topic.lastIndexOf("/?"); if (index > 0) { return new PropertyBag( topic.substring(0, index), new QueryStringDecoder(topic.substring(index)).parameters()); } return null; } private  PropertyBag(final String topicWithoutPropertyBag, final Map<String, List<String>> properties); static PropertyBag fromTopic(final String topic); String getProperty(final String name); Iterator<Map.Entry<String, String>> getPropertiesIterator(); String topicWithoutPropertyBag();  }
@Test public void verifyWhenNoPropertyBagIsSet() { assertNull(PropertyBag.fromTopic("event/tenant/device")); }
@Test public void verifyTopicWithSpecialCharacters() { assertNull(PropertyBag.fromTopic("event/tenant/device/segment1?param=value/segment2/")); }