public static Optional<Constructor<?>> findConstructor(Class<?> clazz, Class<?>[] paramsTypes) {
        if (clazz == null) {
            return Optional.empty();
        }

        // Add to constructor cache
        return CONSTRUCTOR_CACHE.computeIfAbsent(buildMethodKey(clazz, "<init>", paramsTypes), key -> {
            try {
                return Optional.of(setObjectAccessible(clazz.getDeclaredConstructor(paramsTypes)));
            } catch (NoSuchMethodException e) {
                LOGGER.warning(String.format(Locale.ENGLISH, "Can not find constructor for class [%s] with params [%s]",
                        clazz.getName(), Arrays.toString(paramsTypes)));
                return Optional.empty();
            }
        });
    }
@Test
    public void findConstructor() {
        final Optional<Constructor<?>> constructor = ReflectUtils.findConstructor(TestReflect.class, null);
        Assert.assertTrue(constructor.isPresent());
        final Optional<Constructor<?>> paramsCons = ReflectUtils.findConstructor(TestReflect.class,
                new Class[] {int.class, int.class});
        Assert.assertTrue(paramsCons.isPresent());
        final Optional<Constructor<?>> noFoundCons = ReflectUtils.findConstructor(TestReflect.class,
                new Class[] {Integer.class, Integer.class});
        Assert.assertFalse(noFoundCons.isPresent());
    }