UnmodifiableProperties extends Properties { @Override public synchronized void clear() { throw new UnsupportedOperationException(); } 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 testClear() { unmodifiable.clear(); }