DiscoveryResultBuilder { private DiscoveryResultBuilder(ThingUID thingUID) { this.thingUID = thingUID; } private  DiscoveryResultBuilder(ThingUID thingUID); static DiscoveryResultBuilder create(ThingUID thingUID); DiscoveryResultBuilder withThingType(@Nullable ThingTypeUID thingTypeUID); DiscoveryResultBuilder withProperties(@Nullable Map<String, Object> properties); DiscoveryResultBuilder withProperty(String key, Object value); DiscoveryResultBuilder withRepresentationProperty(@Nullable String representationProperty); DiscoveryResultBuilder withBridge(@Nullable ThingUID bridgeUID); DiscoveryResultBuilder withLabel(@Nullable String label); DiscoveryResultBuilder withTTL(long ttl); @SuppressWarnings("deprecation") DiscoveryResult build();  }
@Test public void testDiscoveryResultBuilder() { assertThat(discoveryResult.getThingUID(), is(THING_UID)); assertThat(discoveryResult.getThingTypeUID(), is(THING_TYPE_UID)); assertThat(discoveryResult.getBindingId(), is(BINDING_ID)); assertThat(discoveryResult.getLabel(), is("Test")); assertThat(discoveryResult.getProperties().size(), is(2)); assertThat(discoveryResult.getProperties(), hasEntry(KEY1, VALUE1)); assertThat(discoveryResult.getProperties(), hasEntry(KEY2, VALUE2)); assertThat(discoveryResult.getRepresentationProperty(), is(KEY1)); assertThat(discoveryResult.getTimeToLive(), is(DiscoveryResult.TTL_UNLIMITED)); }