code: public static Class<?> getType( Object arg, boolean boxed ) {
          if ( null == arg || Primitive.NULL == arg )
              return null;
          if ( arg instanceof Primitive && !boxed )
              return ((Primitive) arg).getType();
         return Primitive.unwrap(arg).getClass();
      }
docs: Find the type of an object boxed or not.
  @param arg the object to query.
  @param boxed whether to get a primitive or boxed type.
  @return null if arg null, type of Primitive or getClass.