AgentHolderInfo { @Nonnull public Map<String, String> getLabels() { return labels; } AgentHolderInfo(@Nonnull String id, @Nonnull String taskId, @Nonnull Map<String, String> labels, @Nonnull
            String stateMsg, @Nonnull String name, @Nonnull Instant creationTimestamp, boolean running); @Nonnull String getId(); @Nonnull String getTaskId(); @Nonnull Map<String, String> getLabels(); @Nonnull String getStateMsg(); @Nonnull String getName(); @Nonnull Instant getCreationTimestamp(); boolean isRunning();  }
@Test public void getLabels() { Map<String, String> labels = mapOf(pair("A", "1"), pair("B", "2")); AgentHolderInfo info = new AgentHolderInfo("42", "42", labels, "", "", Instant.MIN, false); assertThat(info.getLabels()).isEqualTo(mapOf(pair("A", "1"), pair("B", "2"))); labels.put("C", "3"); assertThat(info.getLabels()).isEqualTo(mapOf(pair("A", "1"), pair("B", "2"))); assertThatExceptionOfType(UnsupportedOperationException.class).isThrownBy(() -> info.getLabels().put("C", "3")); }