    @Test
    public void testServicesSetIsImmutable()
    {

        Service blue = new Service(Id.<Service>random(), Id.<Node>random(), "blue", "pool", "/location", ImmutableMap.of("key", "value"));

        Services services = new Services("testing", Sets.newHashSet(blue));
        try {
            services.getServices().add(new Service(Id.<Service>random(), Id.<Node>random(), "red", "pool", "/location", ImmutableMap.of("key", "value")));

            // a copy of the internal map is acceptable
            assertEquals(services.getServices(), ImmutableSet.of(blue));
        }
        catch (UnsupportedOperationException e) {
            // an exception is ok, too
        }
    }