@Override
    public Optional<String> getValue(Object arg, String type) {
        try {
            Object object = arg.getClass().getMethod(getKey(type)).invoke(arg);
            return object == null ? Optional.empty() : Optional.of(String.valueOf(object));
        } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
            LOGGER.warning("Cannot invoke the method, type is " + type);
            return Optional.of(Boolean.FALSE.toString());
        }
    }
@Test
    public void testValue() {
        TypeStrategy strategy = new IsMethodTypeStrategy();
        Entity entity = new Entity();
        entity.setEnabled(true);
        entity.setExist(true);

        // normal
        Assert.assertEquals(Boolean.TRUE.toString(), strategy.getValue(entity, ".isEnabled()").orElse(null));

        // the test could not find a way
        Assert.assertEquals(Boolean.FALSE.toString(), strategy.getValue(entity, ".foo()").orElse(null));

        // test null
        Assert.assertNull(strategy.getValue(new Entity(), ".isEnabled()").orElse(null));

        // normal
        Assert.assertEquals(Boolean.TRUE.toString(), strategy.getValue(entity, ".isExist()").orElse(null));

        // the test couldn't find a way
        Assert.assertEquals(Boolean.FALSE.toString(), strategy.getValue(entity, ".foo()").orElse(null));

        // test null
        Assert.assertEquals(Boolean.FALSE.toString(), strategy.getValue(new Entity(), ".isExist()").orElse(null));
    }