code: public static Constructor<?>[] getAllConstructors(Class<?> clazz) {
          Constructor<?>[] declaredConstructors = clazz.getDeclaredConstructors();
          for (Constructor<?> constructor : declaredConstructors) {
              if (!constructor.isAccessible()) {
                  constructor.setAccessible(true);
              }
          }
          return declaredConstructors;
      }
docs: Get all declared constructors in the class and set accessible to
  {@code true}.
  
  @param clazz The class whose constructors to get.
  @return All constructors declared in this class hierarchy.