@Test
public void assertThatNoDuplicateChannelsCanBeAdded() {

    ThingTypeUID thingTypeUID = new ThingTypeUID("test", "test");
    ThingUID thingUID = new ThingUID(thingTypeUID, "test");
    Thing thing = ThingBuilder.create(thingTypeUID, thingUID)
            .withChannels(ChannelBuilder.create(new ChannelUID(thingUID, "channel1"), "").build(),
                    ChannelBuilder.create(new ChannelUID(thingUID, "channel2"), "").build())
            .build();
    assertThrows(IllegalArgumentException.class,
            () -> ThingHelper.addChannelsToThing(thing,
                    Stream.of(ChannelBuilder.create(new ChannelUID(thingUID, "channel2"), "").build(),
                            ChannelBuilder.create(new ChannelUID(thingUID, "channel3"), "").build())
                            .collect(toList())));
}