static Class boxedToPrimitiveType(Class type) { if (type == Bool.class) return bool.class; if (type == Int.class) return int.class; if (type == Long.class) return long.class; if (type == Float.class) return float.class; if (type == Short.class) return short.class; if (type == Char.class) return char.class; if (type == Byte.class) return byte.class; if (type == Double.class) return double.class; null; }