InstantiationUtil { public static boolean hasPublicNullaryConstructor(Class<?> clazz) { Constructor<?>[] constructors = clazz.getConstructors(); for (Constructor<?> constructor : constructors) { if (constructor.getParameterTypes().length == 0 && Modifier.isPublic(constructor.getModifiers())) { return true; } } return false; } private  InstantiationUtil(); static T instantiate(Class<T> clazz, Class<? super T> castTo); static T instantiate(Class<T> clazz); static boolean hasPublicNullaryConstructor(Class<?> clazz); static boolean isPublic(Class<?> clazz); static boolean isProperClass(Class<?> clazz); static boolean isNonStaticInnerClass(Class<?> clazz); static void checkForInstantiation(Class<?> clazz); static String checkForInstantiationError(Class<?> clazz); static T readObjectFromConfig(Configuration config, String key, ClassLoader cl); static void writeObjectToConfig(Object o, Configuration config, String key); static byte[] serializeToByteArray(TypeSerializer<T> serializer, T record); static T deserializeFromByteArray(TypeSerializer<T> serializer, byte[] buf); static T deserializeFromByteArray(TypeSerializer<T> serializer, T reuse, byte[] buf); @SuppressWarnings("unchecked") static T deserializeObject(byte[] bytes, ClassLoader cl); static byte[] serializeObject(Object o); static T clone(T obj); static T clone(T obj, ClassLoader classLoader);  }
@Test public void testHasNullaryConstructor() { assertTrue(InstantiationUtil .hasPublicNullaryConstructor(StringValue.class)); }