if (value instanceof Date) { // because Date it is not inmutable
value = (T) ((Date) value).clone();
}
} else { // it goes CopyFrom
if (value instanceof CopyFrom) {
final CopyFrom source = (CopyFrom) value;
CopyFrom target = createInstance(source.getInterface());
if (target == null) {
target = (CopyFrom) value.getClass().newInstance();
}
target.copyFrom(source);
value = (T) target;
} else {
throw new Exception("unsupported class for 'copyFrom' " + value.getClass());
}
}