Here you can find the source of getNullOrPrimitiveDefault(Class> to)
public static Object getNullOrPrimitiveDefault(Class<?> to)
//package com.java2s; //License from project: Open Source License import java.util.HashMap; public class Main { static HashMap<Class<?>, Object> primitiveDefaults = new HashMap<Class<?>, Object>(); public static Object getNullOrPrimitiveDefault(Class<?> to) { return primitiveDefaults.get(to); // If not a primitive, will return null }/*from w w w .jav a 2 s . c om*/ }