UnmodifiableProperties extends Properties { @Override public Set<Entry<Object, Object>> entrySet() { return unmodifiableSet(super.entrySet()); } UnmodifiableProperties(Properties properties); @Override synchronized Object put(Object key, Object value); @Override synchronized Object remove(Object key); @Override synchronized void clear(); @Override Set<Object> keySet(); @Override Set<Entry<Object, Object>> entrySet(); @Override Collection<Object> values();  }
@Test(expected = UnsupportedOperationException.class) public void testEntrySet() { unmodifiable.entrySet().clear(); }
@Test public void testContentIsSame() { assertTrue(unmodifiable.entrySet().containsAll(props.entrySet())); }