DiscoveryResultImpl implements DiscoveryResult { @Override public ThingTypeUID getThingTypeUID() { ThingTypeUID localThingTypeUID = thingTypeUID; if (localThingTypeUID != null) { return localThingTypeUID; } else { String[] segments = thingUID.getAsString().split(AbstractUID.SEPARATOR); if (!segments[1].isEmpty()) { return new ThingTypeUID(thingUID.getBindingId(), segments[1]); } throw new IllegalArgumentException("ThingTypeUID of thing '" + thingUID.getAsString() + "' is null."); } } DiscoveryResultImpl(); @Deprecated  DiscoveryResultImpl(@Nullable ThingTypeUID thingTypeUID, ThingUID thingUID, @Nullable ThingUID bridgeUID,
            @Nullable Map<String, Object> properties, @Nullable String representationProperty, @Nullable String label,
            long timeToLive); @Override ThingUID getThingUID(); @Override ThingTypeUID getThingTypeUID(); @Override String getBindingId(); @Override Map<String, Object> getProperties(); @Override @Nullable String getRepresentationProperty(); @Override DiscoveryResultFlag getFlag(); @Override String getLabel(); @Override @Nullable ThingUID getBridgeUID(); void synchronize(@Nullable DiscoveryResult sourceResult); void setFlag(@Nullable DiscoveryResultFlag flag); @Override int hashCode(); @Override boolean equals(@Nullable Object obj); @Override String toString(); @Override long getTimestamp(); @Override long getTimeToLive();  }
@Test public void testThingTypeCompatibility() { ThingTypeUID thingTypeUID = new ThingTypeUID("bindingId", "thingType"); DiscoveryResultImpl discoveryResult = new DiscoveryResultImpl(null, new ThingUID(thingTypeUID, "thingId"), null, null, "nothing", "label", DEFAULT_TTL); assertNotNull(discoveryResult.getThingTypeUID()); assertEquals(discoveryResult.getThingTypeUID(), thingTypeUID); }