ChannelBuilder { private ChannelBuilder(ChannelUID channelUID, @Nullable String acceptedItemType, Set<String> defaultTags) { this.channelUID = channelUID; this.acceptedItemType = acceptedItemType; this.defaultTags = defaultTags; this.kind = ChannelKind.STATE; } private  ChannelBuilder(ChannelUID channelUID, @Nullable String acceptedItemType, Set<String> defaultTags); static ChannelBuilder create(ChannelUID channelUID); static ChannelBuilder create(ChannelUID channelUID, @Nullable String acceptedItemType); static ChannelBuilder create(Channel channel); ChannelBuilder withType(@Nullable ChannelTypeUID channelTypeUID); ChannelBuilder withConfiguration(Configuration configuration); ChannelBuilder withProperties(Map<String, String> properties); ChannelBuilder withLabel(String label); ChannelBuilder withDescription(String description); ChannelBuilder withDefaultTags(Set<String> defaultTags); ChannelBuilder withKind(ChannelKind kind); ChannelBuilder withAcceptedItemType(@Nullable String acceptedItemType); ChannelBuilder withAutoUpdatePolicy(@Nullable AutoUpdatePolicy policy); @SuppressWarnings("deprecation") Channel build();  }
@Test public void testChannelBuilder() { assertThat(channel.getAcceptedItemType(), is(SYSTEM_OUTDOOR_TEMPERATURE.getItemType())); assertThat(channel.getChannelTypeUID(), is(SYSTEM_OUTDOOR_TEMPERATURE.getUID())); assertThat(channel.getDefaultTags(), hasSize(0)); assertThat(channel.getDescription(), is("My test channel")); assertThat(channel.getKind(), is(ChannelKind.STATE)); assertThat(channel.getLabel(), is("Test")); assertThat(channel.getProperties().size(), is(2)); assertThat(channel.getProperties().get(KEY1), is(VALUE1)); assertThat(channel.getProperties().get(KEY2), is(VALUE2)); }