code: public static boolean hasAccessibleDefaultConstructor(Class<?> clazz) {
      Constructor<?> constructor;
      try {
        constructor = clazz.getDeclaredConstructor();
      } catch (NoSuchMethodException e) {
        return clazz.getDeclaredConstructors().length == 0;
      }
  
      return !isPrivate(constructor);
    }
docs: Returns {@code true} if the given class has a non-private default
  constructor, or has no constructor at all.