Unwrap primitive values and map voids to nulls.
Non Primitive types remain unchanged.

@param obj object type which may be bsh.Primitive
@return corresponding "normal" Java type, "unwrapping"
any bsh.Primitive types to their wrapper types.
970517
public static Object unwrap( Object obj )
    {
        // map voids to nulls for the outside world
        if (obj == Primitive.VOID)
            return null;

        // unwrap primitives
        if (obj instanceof Primitive)
            return((Primitive)obj).getValue();

        return obj;
    }
987600
public static String serialize(final Object obj) throws IOException {
		final ObjectMapper mapper = new ObjectMapper();
        mapper.disable(MapperFeature.USE_GETTERS_AS_SETTERS);
		return mapper.writeValueAsString(obj);
		
	}
1245598
@Override
    public void visitCode(Code obj) {
        try {
            userValues = new HashMap<>();
            loops = new HashMap<>();
            isInstanceMethod = !getMethod().isStatic();
            super.visitCode(obj);
        } finally {
            userValues = null;
            loops = null;
        }
    }
336947
public static String convertObjectToString(Object obj)
    {
        try {
            ByteArrayOutputStream writer = new ByteArrayOutputStream();
            ObjectOutputStream outStream = new ObjectOutputStream(writer);
            outStream.writeObject(obj);
            outStream.flush();
            writer.flush();
            String string = writer.toString(Constant.OBJECT_ENCODING);//Constants.STRING_ENCODING);
            writer.close();
            outStream.close();
            return string;
        } catch (IOException ex)    {
            ex.printStackTrace();   // Never
        }
        return null;
    }
680994
@SuppressWarnings("unchecked")
    private static <T> T cast(Object obj, Class<T> clazz) {
        if (obj == null) {
            return null;
        }
        if (clazz == null) {
            throw new IllegalArgumentException("parameter 'Class<T> clazz' is not allowed to be null.");
        }
        if (clazz.isEnum() && obj instanceof String) {
            Class<Enum> enumClazz = (Class<Enum>) clazz;
            return (T) Enum.valueOf(enumClazz, obj.toString());
        }
        if (clazz.isPrimitive()) {
            if (clazz == Integer.TYPE) {
                clazz = (Class<T>) Integer.class;
            } else if (clazz == Long.TYPE) {
                clazz = (Class<T>) Long.class;
            } else if (clazz == Short.TYPE) {
                clazz = (Class<T>) Short.class;
            } else if (clazz == Double.TYPE) {
                clazz = (Class<T>) Double.class;
            } else if (clazz == Float.TYPE) {
                clazz = (Class<T>) Float.class;
            } else if (clazz == Character.TYPE) {
                clazz = (Class<T>) Character.class;
            } else if (clazz == Byte.TYPE) {
                clazz = (Class<T>) Byte.class;
            } else if (clazz == Boolean.TYPE) {
                clazz = (Class<T>) Boolean.class;
            }
        }
        return clazz.cast(obj);
    }
68152
function isPlainObject(obj) {
    return (
        typeof obj === 'object' &&
        obj !== null &&
        obj.constructor === Object &&
        Object.prototype.toString.call(obj) === '[object Object]'
    );
}
402493
public static Class<?> unwrap(final Class<?> cls) {
        N.checkArgNotNull(cls, "cls");

        Class<?> unwrapped = PRIMITIVE_2_WRAPPER.getByValue(cls);

        return unwrapped == null ? cls : unwrapped;
    }
92549
@Override
    public void visitCode(Code obj) {
        Method m = getMethod();
        stack.resetForMethodEntry(this);
        initializedRegs.clear();
        modifyRegs.clear();
        Type[] argTypes = m.getArgumentTypes();
        int arg = m.isStatic() ? 0 : 1;
        for (Type argType : argTypes) {
            String argSig = argType.getSignature();
            initializedRegs.set(arg);
            arg += SignatureUtils.getSignatureSize(argSig);
        }
        nullStoreToLocation.clear();
        super.visitCode(obj);

        for (Integer pc : nullStoreToLocation.values()) {
            bugReporter.reportBug(new BugInstance(this, BugType.AIOB_ARRAY_STORE_TO_NULL_REFERENCE.name(), HIGH_PRIORITY).addClass(this).addMethod(this)
                    .addSourceLine(this, pc.intValue()));
        }
    }
611258
public static byte[] toByteArray(Serializable obj) {
        byte[] bytes = null;
        ObjectOutputStream oos = null;
        ByteArrayOutputStream baos = null;
        try {
            baos = new ByteArrayOutputStream();
            oos = new ObjectOutputStream(baos);
            oos.writeObject(obj);
            oos.flush();
        } catch (Exception e) {
            throw new RuntimeException(e);
        } finally {
            if (oos != null) {
                try {
                    oos.close();
                    bytes = baos.toByteArray();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
        }
        return bytes;
    }
1159633
public Iterator<Integer> getBshIterator(final Number obj) {
        int number = obj.intValue();
        if (number == 0)
            return this.emptyIt();
        if (number > 0)
            return IntStream.rangeClosed(0, number).iterator();
        return IntStream.rangeClosed(number, 0).map(i -> number - i).iterator();
    }
1353561
private Object formatVerboseObj(Object obj) {
        // Make sure that we don't truncate any stack traces during verbose logging

        if (obj instanceof TruncatableThrowable) {
            TruncatableThrowable truncatable = (TruncatableThrowable) obj;
            final Throwable wrappedException = truncatable.getWrappedException();
            return DataFormatHelper.throwableToString(wrappedException);
        } else if (obj instanceof Throwable) {
            return DataFormatHelper.throwableToString((Throwable) obj);
        }
        return null;
    }
1000131
@GwtIncompatible("incompatible method")
    public ToStringBuilder append(final Object obj) {
        style.append(buffer, null, obj, null);
        return this;
    }
928206
protected static boolean defaultIgnoreNullValue(Object obj) {
		if(obj instanceof CharSequence || obj instanceof JSONTokener || obj instanceof Map) {
			return false;
		}
		return true;
	}
189592
@NullSafe
  public static Class<?> getClass(Object obj) {
    return obj != null ? obj.getClass() : null;
  }
522181
public static boolean isPrimitive(Object obj) {
        boolean rv = obj.getClass().isPrimitive() || obj instanceof String || obj instanceof Integer
                || obj instanceof Long || obj instanceof Byte || obj instanceof Character || obj instanceof Boolean
                || obj instanceof Short || obj instanceof Float || obj instanceof Double || obj instanceof BigDecimal
                || obj instanceof BigInteger;
        return rv;
    }
784234
public ISFSObject object2params(ClassUnwrapper unwrapper,
            Object object, ISFSObject result) {
        List<GetterMethodCover> methods = unwrapper.getMethods();
        for(GetterMethodCover method : methods) {
            Object value = method.invoke(object);
            if(value == null)
                continue;
            parseMethod(value, method, result);
        }
        return result;
    }
1362649
public static ScryptKDFParams getInstance(Object obj)
    {
        if (obj instanceof ScryptKDFParams) {
            return (ScryptKDFParams) obj;
        }
        if (obj != null) {
            return new ScryptKDFParams(ASN1Sequence.getInstance(obj));
        }
        return null;
    }