class GetterReferMetadataCreator implements ReferMetadataCreator {

    @Override
    public ReferMetadata getReferMetadata(Type type, String path) {
        Class<?> classType = getRawType(type);
        List<String> gettersNames = createGettersNames(classType, path.replace("[*]", ""));
        Method getterMethod = gettersNames.stream()
                .flatMap(getter -> Arrays.stream(classType.getMethods())
                        .filter(method -> method.getParameterCount() == 0)
                        .filter(method -> method.getName().equals(getter)))
                .findFirst()
                .get();
        String getterName = getterMethod.getName() + "()";
        Type refType = getterMethod.getGenericReturnType();
        return new ReferMetadata(refType, getterName, path);
    }

}