Here you can find the source of toObject(Object value)
public static Object toObject(Object value)
//package com.java2s; //License from project: Open Source License public class Main { public static Object toObject(Object value) { return toObject(value, null); }//w w w . jav a2 s . c om public static Object toObject(Object value, Object defaultValue) { return (value != null) ? value : defaultValue; } }