### Question:
BeanMap extends AbstractMap<String, Object> implements Cloneable { @Override public Object clone() throws CloneNotSupportedException { BeanMap newMap = (BeanMap) super.clone(); if (bean == null) { return newMap; } Object newBean = null; Class<?> beanClass = null; try { beanClass = bean.getClass(); newBean = beanClass.newInstance(); } catch (Exception e) { throw new CloneNotSupportedException("Unable to instantiate the underlying bean \"" + beanClass.getName() + "\": " + e); } try { newMap.setBean(newBean); } catch (Exception exception) { throw new CloneNotSupportedException("Unable to set bean in the cloned bean map: " + exception); } try { for (String key : readMethods.keySet()) { if (getWriteMethod(key) != null) { newMap.put(key, get(key)); } } } catch (Exception exception) { throw new CloneNotSupportedException("Unable to copy bean values to cloned bean map: " + exception); } return newMap; } BeanMap();  BeanMap(Object bean); @Override String toString(); @Override Object clone(); void putAllWriteable(BeanMap map); @Override void clear(); boolean containsKey(String name); Object get(String name); @Override Object put(String name, Object value); @Override int size(); @Override Set<String> keySet(); @Override Set<Entry<String, Object>> entrySet(); @Override Collection<Object> values(); Class<?> getType(String name); Iterator<String> keyIterator(); Iterator<Object> valueIterator(); Iterator<Entry<String, Object>> entryIterator(); Object getBean(); void setBean(Object newBean); Method getReadMethod(String name); Method getWriteMethod(String name);  }### Answer:
@Test public void clone_() throws CloneNotSupportedException { assertEquals(beanMap, beanMap.clone()); }