class MatrixParameterResolver implements ParameterResolver<MatrixParam> {

    @Override
    public Object resolve(org.everrest.core.Parameter parameter, ApplicationContext context) throws Exception {
        String param = matrixParam.value();
        TypeProducer typeProducer = typeProducerFactory.createTypeProducer(parameter.getParameterClass(), parameter.getGenericType());
        List<PathSegment> pathSegments = context.getUriInfo().getPathSegments(!parameter.isEncoded());

        PathSegment pathSegment = Iterables.getLast(pathSegments, null);

        return typeProducer.createValue(param,
                                        pathSegment == null ? new MultivaluedHashMap<>() : pathSegment.getMatrixParameters(),
                                        parameter.getDefaultValue());
    }

      MatrixParameterResolver(MatrixParam matrixParam, TypeProducerFactory typeProducerFactory);

}