Here you can find the source of clone(Object value)
static Object clone(Object value)
//package com.java2s; //License from project: Open Source License public class Main { static Object clone(Object value) {// throws // CloneNotSupportedException { Object rval = null;//w w w. j a va 2s .c om if (value instanceof Cloneable) { try { rval = value.getClass().getMethod("clone").invoke(value); } catch (final Exception e) { rval = e; } } if (rval == null || rval instanceof Exception) { // the object wasn't cloneable, or an error occured if (value == null || value instanceof String || value instanceof Number || value instanceof Boolean) { // strings numbers and booleans are immutable rval = value; } else { // TODO: making this throw runtime exception so it doesn't have // to be caught // because simply it should never fail in the case of JSON-LD // and means that // the input JSON-LD is invalid throw new RuntimeException(new CloneNotSupportedException( (rval instanceof Exception ? ((Exception) rval).getMessage() : ""))); } } return rval; } }