Here you can find the source of toPrimitive(Class> clazz)
public static Class<?> toPrimitive(Class<?> clazz)
//package com.java2s; //License from project: Open Source License public class Main { public static Class<?> toPrimitive(Class<?> clazz) { if (clazz == Boolean.class) return boolean.class; if (clazz == Character.class) return char.class; if (clazz == Byte.class) return byte.class; if (clazz == Short.class) return short.class; if (clazz == Integer.class) return int.class; if (clazz == Long.class) return long.class; if (clazz == Float.class) return float.class; if (clazz == Double.class) return double.class; if (clazz == Void.class) return void.class; return clazz; }//from w w w . j a v a 2 s . com }