@SuppressWarnings("unchecked")
    public static <T> T convert(Class<T> klass, String value) {
        if (Strings.isNullOrEmpty(value)) {
            throw new IllegalArgumentException("Value must not be empty.");
        }

        if (Objects.isNull(converters.get(klass))) {
            throw new IllegalArgumentException("No conversion supported for given class.");
        }
        return (T)converters.get(klass).apply(value);
    }
@Test
    public void testConvert() {
        int intResult = PasswordParamConverter.convert(Integer.class, "8");
        Assert.assertEquals(8, intResult);

        String stringResult = PasswordParamConverter.convert(String.class, "test");
        Assert.assertEquals("test", stringResult);

        boolean booleanResult = PasswordParamConverter.convert(Boolean.class, "false");
        Assert.assertEquals(false, booleanResult);

        double doubleResult = PasswordParamConverter.convert(Double.class, "0.0012");
        Assert.assertEquals(0.0012, doubleResult, 0);
    }