code: public static Class[] getTypes(Object... args) {
        if (args.length == 0) {
           return new Class[0];
        }
        Class[] types = new Class[args.length];
        for (int i = 0; i < args.length; i++) {
           types[i] = args[i] == null ? Object.class : args[i].getClass();
        }
        return types;
     }
docs: Gets the types for an array of objects
  
  @param args The arguments to get types for
  @return A 0 sized array if the array is null, otherwise an array of class equalling the classes of the given args
  or <code>Object.cass</code> if the arg is null.