### Question:
ObjectAccessor implements PropertyAccessor<Object> { @Override public Object getCopy(Object object) { if (object == null) return null; if (object instanceof byte[]) { byte[] byteArr = (byte[]) object; return byteArr.clone(); } else if (object instanceof Cloneable) { Class<?> clazz = object.getClass(); Object o = null; try { Method m = clazz.getMethod("clone"); o = m.invoke(object); } catch (SecurityException e) { log.warn("Object of class " + object.getClass() + " can't be cloned, due to exception:" + e.getMessage()); return object; } catch (IllegalArgumentException e) { log.warn("Object of class " + object.getClass() + " can't be cloned, due to exception:" + e.getMessage()); return object; } catch (NoSuchMethodException e) { log.warn("Object of class " + object.getClass() + " can't be cloned, due to exception:" + e.getMessage()); return object; } catch (IllegalAccessException e) { log.warn("Object of class " + object.getClass() + " can't be cloned, due to exception:" + e.getMessage()); return object; } catch (InvocationTargetException e) { log.warn("Object of class " + object.getClass() + " can't be cloned, due to exception:" + e.getMessage()); return object; } return o; } else { return object; } }  @Override final Object fromBytes(Class targetClass, byte[] bytes); @Override final byte[] toBytes(Object o); @Override final String toString(Object object); @Override Object fromString(Class targetClass, String s); @Override Object getCopy(Object object); Object getInstance(Class<?> clazz); static Logger log; }### Answer:
@Test public void testGetCopy() { Assert.assertNull(accessor.getCopy(null)); PersonalDetail pd = new PersonalDetail("Amresh", "password", "single"); Object pdCopy = accessor.getCopy(pd); Assert.assertNotNull(pdCopy); Assert.assertTrue(pdCopy instanceof PersonalDetail); Assert.assertTrue(pd == pdCopy); Assert.assertTrue(pd.getPersonalDetailId() == ((PersonalDetail)pdCopy).getPersonalDetailId()); Assert.assertTrue(pd.getName() == ((PersonalDetail)pdCopy).getName()); Assert.assertTrue(pd.getPassword() == ((PersonalDetail)pdCopy).getPassword()); Assert.assertTrue(pd.getRelationshipStatus() == ((PersonalDetail)pdCopy).getRelationshipStatus()); byte[] b = "Hello".getBytes(); Object bCopy = accessor.getCopy(b); Assert.assertNotNull(bCopy); Assert.assertTrue(bCopy instanceof byte[]); }