diff --git a/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/builders/AutomationChannelBuilder.java b/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/builders/AutomationChannelBuilder.java index ed1216a99c263..10782b22b991c 100644 --- a/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/builders/AutomationChannelBuilder.java +++ b/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/builders/AutomationChannelBuilder.java @@ -21,7 +21,6 @@ import java.util.StringJoiner; import java.util.stream.Collectors; -import org.eclipse.jdt.annotation.NonNull; import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; import org.openhab.binding.hdpowerview.internal.HDPowerViewBindingConstants; @@ -125,10 +124,10 @@ public AutomationChannelBuilder withScheduledEvents(List schedul * @return the {@link Channel} list */ public List build() { + List scheduledEvents = this.scheduledEvents; if (scheduledEvents == null || (scenes == null && sceneCollections == null)) { return getChannelList(0); } - List scheduledEvents = (@NonNull List) this.scheduledEvents; List channels = getChannelList(scheduledEvents.size()); scheduledEvents.stream().forEach(scheduledEvent -> { Channel channel = createChannel(scheduledEvent); @@ -157,26 +156,27 @@ public List build() { private @Nullable String getReferencedSceneOrSceneCollectionName(ScheduledEvent scheduledEvent) { if (scheduledEvent.sceneId > 0) { + Map scenes = this.scenes; if (scenes == null) { logger.warn("Scheduled event '{}' references scene '{}', but no scenes are loaded", scheduledEvent.id, scheduledEvent.sceneId); return null; } - Scene scene = ((@NonNull Map) scenes).get(scheduledEvent.sceneId); + Scene scene = scenes.get(scheduledEvent.sceneId); if (scene != null) { return scene.getName(); } logger.warn("Scene '{}' was not found for scheduled event '{}'", scheduledEvent.sceneId, scheduledEvent.id); return null; } else if (scheduledEvent.sceneCollectionId > 0) { + Map sceneCollections = this.sceneCollections; if (sceneCollections == null) { logger.warn( "Scheduled event '{}' references scene collection '{}', but no scene collections are loaded", scheduledEvent.id, scheduledEvent.sceneCollectionId); return null; } - SceneCollection sceneCollection = ((@NonNull Map) sceneCollections) - .get(scheduledEvent.sceneCollectionId); + SceneCollection sceneCollection = sceneCollections.get(scheduledEvent.sceneCollectionId); if (sceneCollection != null) { return sceneCollection.getName(); } diff --git a/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/builders/BaseChannelBuilder.java b/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/builders/BaseChannelBuilder.java index 35f2ac19b8519..6ac875c460c90 100644 --- a/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/builders/BaseChannelBuilder.java +++ b/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/builders/BaseChannelBuilder.java @@ -15,7 +15,6 @@ import java.util.ArrayList; import java.util.List; -import org.eclipse.jdt.annotation.NonNull; import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; import org.openhab.binding.hdpowerview.internal.HDPowerViewBindingConstants; @@ -48,6 +47,7 @@ protected BaseChannelBuilder(HDPowerViewTranslationProvider translationProvider, } protected List getChannelList(int initialCapacity) { - return channels != null ? (@NonNull List) channels : new ArrayList<>(initialCapacity); + List channels = this.channels; + return channels != null ? channels : new ArrayList<>(initialCapacity); } } diff --git a/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/builders/SceneChannelBuilder.java b/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/builders/SceneChannelBuilder.java index 06c0bb743ac1b..ad11985cb4cdc 100644 --- a/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/builders/SceneChannelBuilder.java +++ b/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/builders/SceneChannelBuilder.java @@ -14,7 +14,6 @@ import java.util.List; -import org.eclipse.jdt.annotation.NonNull; import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; import org.openhab.binding.hdpowerview.internal.HDPowerViewBindingConstants; @@ -83,10 +82,10 @@ public SceneChannelBuilder withScenes(List scenes) { * @return the {@link Channel} list */ public List build() { + List scenes = this.scenes; if (scenes == null) { return getChannelList(0); } - List scenes = (@NonNull List) this.scenes; List channels = getChannelList(scenes.size()); scenes.stream().sorted().forEach(scene -> channels.add(createChannel(scene))); return channels; diff --git a/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/builders/SceneGroupChannelBuilder.java b/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/builders/SceneGroupChannelBuilder.java index 971e7c4b062a5..2b70b21d2e6a0 100644 --- a/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/builders/SceneGroupChannelBuilder.java +++ b/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/builders/SceneGroupChannelBuilder.java @@ -14,7 +14,6 @@ import java.util.List; -import org.eclipse.jdt.annotation.NonNull; import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; import org.openhab.binding.hdpowerview.internal.HDPowerViewBindingConstants; @@ -84,10 +83,10 @@ public SceneGroupChannelBuilder withSceneCollections(List scene * @return the {@link Channel} list */ public List build() { + List sceneCollections = this.sceneCollections; if (sceneCollections == null) { return getChannelList(0); } - List sceneCollections = (@NonNull List) this.sceneCollections; List channels = getChannelList(sceneCollections.size()); sceneCollections.stream().sorted().forEach(sceneCollection -> channels.add(createChannel(sceneCollection))); return channels; diff --git a/bundles/org.openhab.binding.hdpowerview/src/test/java/org/openhab/binding/hdpowerview/AutomationChannelBuilderTest.java b/bundles/org.openhab.binding.hdpowerview/src/test/java/org/openhab/binding/hdpowerview/AutomationChannelBuilderTest.java index 465672926a639..e03b0dd5f0f02 100644 --- a/bundles/org.openhab.binding.hdpowerview/src/test/java/org/openhab/binding/hdpowerview/AutomationChannelBuilderTest.java +++ b/bundles/org.openhab.binding.hdpowerview/src/test/java/org/openhab/binding/hdpowerview/AutomationChannelBuilderTest.java @@ -19,7 +19,7 @@ import java.util.Base64; import java.util.List; -import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.openhab.binding.hdpowerview.internal.HDPowerViewBindingConstants; @@ -39,21 +39,21 @@ * * @author Jacob Laursen - Initial contribution */ +@NonNullByDefault public class AutomationChannelBuilderTest { private static final ChannelGroupUID CHANNEL_GROUP_UID = new ChannelGroupUID( new ThingUID(HDPowerViewBindingConstants.BINDING_ID, AutomationChannelBuilderTest.class.getSimpleName()), HDPowerViewBindingConstants.CHANNELTYPE_AUTOMATION_ENABLED); - private HDPowerViewTranslationProvider translationProvider; - private AutomationChannelBuilder builder; - private List scenes; - private List sceneCollections; + private static final HDPowerViewTranslationProvider translationProvider = new HDPowerViewTranslationProvider( + mock(Bundle.class), new TranslationProviderForTests(), new LocaleProviderForTests()); + private AutomationChannelBuilder builder = AutomationChannelBuilder.create(translationProvider, CHANNEL_GROUP_UID); + private List scenes = new ArrayList<>(); + private List sceneCollections = new ArrayList<>(); @BeforeEach private void setUp() { - translationProvider = new HDPowerViewTranslationProvider(mock(Bundle.class), new TranslationProviderForTests(), - new LocaleProviderForTests()); builder = AutomationChannelBuilder.create(translationProvider, CHANNEL_GROUP_UID); Scene scene = new Scene(); @@ -74,9 +74,7 @@ public void sceneSunriseWeekends() { scheduledEvent.daySunday = true; List scheduledEvents = new ArrayList<>(List.of(scheduledEvent)); - - @NonNull - List<@NonNull Channel> channels = builder.withScenes(scenes).withScheduledEvents(scheduledEvents).build(); + List channels = builder.withScenes(scenes).withScheduledEvents(scheduledEvents).build(); assertEquals(1, channels.size()); assertEquals("TestScene, At sunrise, Weekends", channels.get(0).getLabel()); @@ -92,9 +90,7 @@ public void sceneSunsetWeekdays() { scheduledEvent.dayFriday = true; List scheduledEvents = new ArrayList<>(List.of(scheduledEvent)); - - @NonNull - List<@NonNull Channel> channels = builder.withScenes(scenes).withScheduledEvents(scheduledEvents).build(); + List channels = builder.withScenes(scenes).withScheduledEvents(scheduledEvents).build(); assertEquals(1, channels.size()); assertEquals("TestScene, At sunset, Weekdays", channels.get(0).getLabel()); @@ -114,9 +110,7 @@ public void sceneTimeAllDays() { scheduledEvent.minute = 30; List scheduledEvents = new ArrayList<>(List.of(scheduledEvent)); - - @NonNull - List<@NonNull Channel> channels = builder.withScenes(scenes).withScheduledEvents(scheduledEvents).build(); + List channels = builder.withScenes(scenes).withScheduledEvents(scheduledEvents).build(); assertEquals(1, channels.size()); assertEquals("TestScene, 06:30, All days", channels.get(0).getLabel()); @@ -130,9 +124,7 @@ public void sceneMinutesBeforeSunriseMondayTuesday() { scheduledEvent.minute = -15; List scheduledEvents = new ArrayList<>(List.of(scheduledEvent)); - - @NonNull - List<@NonNull Channel> channels = builder.withScenes(scenes).withScheduledEvents(scheduledEvents).build(); + List channels = builder.withScenes(scenes).withScheduledEvents(scheduledEvents).build(); assertEquals(1, channels.size()); assertEquals("TestScene, 15m before sunrise, Mon, Tue", channels.get(0).getLabel()); @@ -145,9 +137,7 @@ public void sceneHoursMinutesAfterSunriseMonday() { scheduledEvent.minute = 61; List scheduledEvents = new ArrayList<>(List.of(scheduledEvent)); - - @NonNull - List<@NonNull Channel> channels = builder.withScenes(scenes).withScheduledEvents(scheduledEvents).build(); + List channels = builder.withScenes(scenes).withScheduledEvents(scheduledEvents).build(); assertEquals(1, channels.size()); assertEquals("TestScene, 1hr 1m after sunrise, Mon", channels.get(0).getLabel()); @@ -162,9 +152,7 @@ public void sceneMinutesBeforeSunsetWednesdayThursdayFriday() { scheduledEvent.minute = -59; List scheduledEvents = new ArrayList<>(List.of(scheduledEvent)); - - @NonNull - List<@NonNull Channel> channels = builder.withScenes(scenes).withScheduledEvents(scheduledEvents).build(); + List channels = builder.withScenes(scenes).withScheduledEvents(scheduledEvents).build(); assertEquals(1, channels.size()); assertEquals("TestScene, 59m before sunset, Wed, Thu, Fri", channels.get(0).getLabel()); @@ -179,9 +167,7 @@ public void sceneHourAfterSunsetFridaySaturdaySunday() { scheduledEvent.minute = 60; List scheduledEvents = new ArrayList<>(List.of(scheduledEvent)); - - @NonNull - List<@NonNull Channel> channels = builder.withScenes(scenes).withScheduledEvents(scheduledEvents).build(); + List channels = builder.withScenes(scenes).withScheduledEvents(scheduledEvents).build(); assertEquals(1, channels.size()); assertEquals("TestScene, 1hr after sunset, Fri, Sat, Sun", channels.get(0).getLabel()); @@ -193,10 +179,8 @@ public void sceneCollection() { ScheduledEvents.SCHEDULED_EVENT_TYPE_SUNRISE); List scheduledEvents = new ArrayList<>(List.of(scheduledEvent)); - - @NonNull - List<@NonNull Channel> channels = builder.withSceneCollections(sceneCollections) - .withScheduledEvents(scheduledEvents).build(); + List channels = builder.withSceneCollections(sceneCollections).withScheduledEvents(scheduledEvents) + .build(); assertEquals(1, channels.size()); assertEquals("TestSceneCollection, At sunrise, ", channels.get(0).getLabel()); @@ -207,9 +191,7 @@ public void suppliedListIsUsed() { ScheduledEvent scheduledEvent = createScheduledEventWithScene(ScheduledEvents.SCHEDULED_EVENT_TYPE_SUNRISE); List scheduledEvents = new ArrayList<>(List.of(scheduledEvent)); List existingChannels = new ArrayList<>(0); - - @NonNull - List<@NonNull Channel> channels = builder.withScenes(scenes).withScheduledEvents(scheduledEvents) + List channels = builder.withScenes(scenes).withScheduledEvents(scheduledEvents) .withChannels(existingChannels).build(); assertEquals(existingChannels, channels); @@ -217,8 +199,7 @@ public void suppliedListIsUsed() { @Test public void emptyListWhenNoScheduledEvents() { - @NonNull - List<@NonNull Channel> channels = builder.build(); + List channels = builder.build(); assertEquals(0, channels.size()); } @@ -227,9 +208,7 @@ public void emptyListWhenNoScheduledEvents() { public void emptyListWhenNoScenesOrSceneCollections() { ScheduledEvent scheduledEvent = createScheduledEventWithScene(ScheduledEvents.SCHEDULED_EVENT_TYPE_SUNRISE); List scheduledEvents = new ArrayList<>(List.of(scheduledEvent)); - - @NonNull - List<@NonNull Channel> channels = builder.withScheduledEvents(scheduledEvents).build(); + List channels = builder.withScheduledEvents(scheduledEvents).build(); assertEquals(0, channels.size()); } @@ -239,9 +218,7 @@ public void emptyListWhenNoSceneForScheduledEvent() { ScheduledEvent scheduledEvent = createScheduledEventWithSceneCollection( ScheduledEvents.SCHEDULED_EVENT_TYPE_SUNRISE); List scheduledEvents = new ArrayList<>(List.of(scheduledEvent)); - - @NonNull - List<@NonNull Channel> channels = builder.withScenes(scenes).withScheduledEvents(scheduledEvents).build(); + List channels = builder.withScenes(scenes).withScheduledEvents(scheduledEvents).build(); assertEquals(0, channels.size()); } @@ -251,9 +228,8 @@ public void emptyListWhenNoSceneCollectionForScheduledEvent() { ScheduledEvent scheduledEvent = createScheduledEventWithScene(ScheduledEvents.SCHEDULED_EVENT_TYPE_SUNRISE); List scheduledEvents = new ArrayList<>(List.of(scheduledEvent)); - @NonNull - List<@NonNull Channel> channels = builder.withSceneCollections(sceneCollections) - .withScheduledEvents(scheduledEvents).build(); + List channels = builder.withSceneCollections(sceneCollections).withScheduledEvents(scheduledEvents) + .build(); assertEquals(0, channels.size()); } @@ -263,9 +239,7 @@ public void groupAndIdAreCorrect() { ScheduledEvent scheduledEvent = createScheduledEventWithScene(ScheduledEvents.SCHEDULED_EVENT_TYPE_SUNRISE); scheduledEvent.id = 42; List scheduledEvents = new ArrayList<>(List.of(scheduledEvent)); - - @NonNull - List<@NonNull Channel> channels = builder.withScenes(scenes).withScheduledEvents(scheduledEvents).build(); + List channels = builder.withScenes(scenes).withScheduledEvents(scheduledEvents).build(); assertEquals(1, channels.size()); assertEquals(CHANNEL_GROUP_UID.getId(), channels.get(0).getUID().getGroupId()); diff --git a/bundles/org.openhab.binding.hdpowerview/src/test/java/org/openhab/binding/hdpowerview/SceneChannelBuilderTest.java b/bundles/org.openhab.binding.hdpowerview/src/test/java/org/openhab/binding/hdpowerview/SceneChannelBuilderTest.java index 1769b28f34dbe..94065aa07f043 100644 --- a/bundles/org.openhab.binding.hdpowerview/src/test/java/org/openhab/binding/hdpowerview/SceneChannelBuilderTest.java +++ b/bundles/org.openhab.binding.hdpowerview/src/test/java/org/openhab/binding/hdpowerview/SceneChannelBuilderTest.java @@ -19,7 +19,7 @@ import java.util.Base64; import java.util.List; -import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.openhab.binding.hdpowerview.internal.HDPowerViewBindingConstants; @@ -36,28 +36,26 @@ * * @author Jacob Laursen - Initial contribution */ +@NonNullByDefault public class SceneChannelBuilderTest { private static final ChannelGroupUID CHANNEL_GROUP_UID = new ChannelGroupUID( new ThingUID(HDPowerViewBindingConstants.BINDING_ID, SceneChannelBuilderTest.class.getSimpleName()), HDPowerViewBindingConstants.CHANNELTYPE_SCENE_ACTIVATE); - private HDPowerViewTranslationProvider translationProvider; - private SceneChannelBuilder builder; + private static final HDPowerViewTranslationProvider translationProvider = new HDPowerViewTranslationProvider( + mock(Bundle.class), new TranslationProviderForTests(), new LocaleProviderForTests()); + private SceneChannelBuilder builder = SceneChannelBuilder.create(translationProvider, CHANNEL_GROUP_UID); @BeforeEach private void setUp() { - translationProvider = new HDPowerViewTranslationProvider(mock(Bundle.class), new TranslationProviderForTests(), - new LocaleProviderForTests()); builder = SceneChannelBuilder.create(translationProvider, CHANNEL_GROUP_UID); } @Test public void labelIsCorrect() { List scenes = createScenes(); - - @NonNull - List<@NonNull Channel> channels = builder.withScenes(scenes).build(); + List channels = builder.withScenes(scenes).build(); assertEquals(1, channels.size()); assertEquals("TestScene", channels.get(0).getLabel()); @@ -66,9 +64,7 @@ public void labelIsCorrect() { @Test public void descriptionIsCorrect() { List scenes = createScenes(); - - @NonNull - List<@NonNull Channel> channels = builder.withScenes(scenes).build(); + List channels = builder.withScenes(scenes).build(); assertEquals(1, channels.size()); assertEquals("Activates the scene 'TestScene'", channels.get(0).getDescription()); @@ -77,9 +73,7 @@ public void descriptionIsCorrect() { @Test public void groupAndIdAreCorrect() { List scenes = createScenes(); - - @NonNull - List<@NonNull Channel> channels = builder.withScenes(scenes).build(); + List channels = builder.withScenes(scenes).build(); assertEquals(1, channels.size()); assertEquals(CHANNEL_GROUP_UID.getId(), channels.get(0).getUID().getGroupId()); @@ -90,17 +84,14 @@ public void groupAndIdAreCorrect() { public void suppliedListIsUsed() { List scenes = createScenes(); List existingChannels = new ArrayList<>(0); - - @NonNull - List<@NonNull Channel> channels = builder.withScenes(scenes).withChannels(existingChannels).build(); + List channels = builder.withScenes(scenes).withChannels(existingChannels).build(); assertEquals(existingChannels, channels); } @Test public void emptyListWhenNoScenes() { - @NonNull - List<@NonNull Channel> channels = builder.build(); + List channels = builder.build(); assertEquals(0, channels.size()); } diff --git a/bundles/org.openhab.binding.hdpowerview/src/test/java/org/openhab/binding/hdpowerview/SceneGroupChannelBuilderTest.java b/bundles/org.openhab.binding.hdpowerview/src/test/java/org/openhab/binding/hdpowerview/SceneGroupChannelBuilderTest.java index dbef2580ff45a..16286650d59fe 100644 --- a/bundles/org.openhab.binding.hdpowerview/src/test/java/org/openhab/binding/hdpowerview/SceneGroupChannelBuilderTest.java +++ b/bundles/org.openhab.binding.hdpowerview/src/test/java/org/openhab/binding/hdpowerview/SceneGroupChannelBuilderTest.java @@ -19,7 +19,7 @@ import java.util.Base64; import java.util.List; -import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.openhab.binding.hdpowerview.internal.HDPowerViewBindingConstants; @@ -36,28 +36,26 @@ * * @author Jacob Laursen - Initial contribution */ +@NonNullByDefault public class SceneGroupChannelBuilderTest { private static final ChannelGroupUID CHANNEL_GROUP_UID = new ChannelGroupUID( new ThingUID(HDPowerViewBindingConstants.BINDING_ID, SceneGroupChannelBuilderTest.class.getSimpleName()), HDPowerViewBindingConstants.CHANNELTYPE_SCENE_GROUP_ACTIVATE); - private HDPowerViewTranslationProvider translationProvider; - private SceneGroupChannelBuilder builder; + private static final HDPowerViewTranslationProvider translationProvider = new HDPowerViewTranslationProvider( + mock(Bundle.class), new TranslationProviderForTests(), new LocaleProviderForTests()); + private SceneGroupChannelBuilder builder = SceneGroupChannelBuilder.create(translationProvider, CHANNEL_GROUP_UID); @BeforeEach private void setUp() { - translationProvider = new HDPowerViewTranslationProvider(mock(Bundle.class), new TranslationProviderForTests(), - new LocaleProviderForTests()); builder = SceneGroupChannelBuilder.create(translationProvider, CHANNEL_GROUP_UID); } @Test public void labelIsCorrect() { List sceneCollections = createSceneCollections(); - - @NonNull - List<@NonNull Channel> channels = builder.withSceneCollections(sceneCollections).build(); + List channels = builder.withSceneCollections(sceneCollections).build(); assertEquals(1, channels.size()); assertEquals("TestSceneCollection", channels.get(0).getLabel()); @@ -66,9 +64,7 @@ public void labelIsCorrect() { @Test public void descriptionIsCorrect() { List sceneCollections = createSceneCollections(); - - @NonNull - List<@NonNull Channel> channels = builder.withSceneCollections(sceneCollections).build(); + List channels = builder.withSceneCollections(sceneCollections).build(); assertEquals(1, channels.size()); assertEquals("Activates the scene group 'TestSceneCollection'", channels.get(0).getDescription()); @@ -77,9 +73,7 @@ public void descriptionIsCorrect() { @Test public void groupAndIdAreCorrect() { List sceneCollections = createSceneCollections(); - - @NonNull - List<@NonNull Channel> channels = builder.withSceneCollections(sceneCollections).build(); + List channels = builder.withSceneCollections(sceneCollections).build(); assertEquals(1, channels.size()); assertEquals(CHANNEL_GROUP_UID.getId(), channels.get(0).getUID().getGroupId()); @@ -90,18 +84,14 @@ public void groupAndIdAreCorrect() { public void suppliedListIsUsed() { List sceneCollections = createSceneCollections(); List existingChannels = new ArrayList<>(0); - - @NonNull - List<@NonNull Channel> channels = builder.withSceneCollections(sceneCollections).withChannels(existingChannels) - .build(); + List channels = builder.withSceneCollections(sceneCollections).withChannels(existingChannels).build(); assertEquals(existingChannels, channels); } @Test public void emptyListWhenNoSceneCollections() { - @NonNull - List<@NonNull Channel> channels = builder.build(); + List channels = builder.build(); assertEquals(0, channels.size()); }