StaticAnnouncement { @NotNull public Map<String, String> getProperties() { return properties; } @JsonCreator  StaticAnnouncement(
            @JsonProperty("environment") String environment,
            @JsonProperty("type") String type,
            @JsonProperty("pool") String pool,
            @JsonProperty("location") String location,
            @JsonProperty("properties") Map<String, String> properties); @NotNull String getEnvironment(); String getLocation(); @NotNull String getType(); @NotNull String getPool(); @NotNull Map<String, String> getProperties(); @Override boolean equals(Object o); @Override int hashCode();  }
@Test public void testCreatesDefensiveCopyOfProperties() { Map<String, String> properties = Maps.newHashMap(); properties.put("key", "value"); StaticAnnouncement announcement = new StaticAnnouncement("testing", "type", "pool", "/a/b", properties); assertEquals(announcement.getProperties(), properties); properties.put("key2", "value2"); assertNotEquals(announcement.getProperties(), properties); }
@Test public void testImmutableProperties() { StaticAnnouncement announcement = new StaticAnnouncement("testing", "type", "pool", "/a/b", ImmutableMap.of("key", "value")); try { announcement.getProperties().put("key2", "value2"); assertEquals(announcement.getProperties(), ImmutableMap.of("key", "value")); } catch (UnsupportedOperationException e) { } }