Java Utililty Methods Object Deep Clone

List of utility methods to do Object Deep Clone

Description

The list of methods to do Object Deep Clone are organized into topic(s).

Method

TdeepCloneOnlyIfContains(final T objectToBeClonned, final T[] objects)
clones only if objects contains the given objectToBeClonned , otherwise returns the same object.
if (objectToBeClonned == null || objects == null) {
    return objectToBeClonned;
final Set<T> objectsSet = new HashSet<T>(Arrays.asList(objects));
return objectsSet.contains(objectToBeClonned) ? deepClone(objectToBeClonned) : objectToBeClonned;