NewAgentHolderInfo { @Nonnull public List<String> getWarnings() { return warnings; } NewAgentHolderInfo(@Nonnull String id, @Nonnull String name, @Nonnull String resolvedImage,
            @Nonnull List<String> warnings); @Nonnull String getId(); @Nonnull String getName(); @Nonnull String getResolvedImage(); @Nonnull List<String> getWarnings();  }
@Test public void getWarnings() { assertThat(new NewAgentHolderInfo(TestUtils.createRandomSha256(), "", "", Collections.emptyList()) .getWarnings()). isEmpty(); List<String> warnings = Arrays.asList("warning1", "warning2", "warning3"); assertThat(new NewAgentHolderInfo(TestUtils.createRandomSha256(), "", "", warnings).getWarnings()). containsExactlyElementsOf(warnings). isNotSameAs(warnings); assertThatExceptionOfType(UnsupportedOperationException.class).isThrownBy(() -> warnings.add("warning4")); }