code: public static Object instanceFromTarget(Object target) throws InstantiationException, IllegalAccessException {
      if (target == null) return null;
  
      if (target instanceof Class) {
        // Create handler from class
        Class<?> klass = (Class<?>) target;
        return klass.newInstance();
      } else {
        return target;
      }
    }
docs: When target is a class, this method calls "newInstance" on the class.
  Otherwise it returns the target as is.
  
  @return null if target is null