UnmodifiableProperties extends Properties { @Override public Set<Object> keySet() { return unmodifiableSet(super.keySet()); } 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 testKeySet() { unmodifiable.keySet().clear(); }