public <T> T fromQueryParams(Class<T> clazz) {
        Map<String, String> fieldValues = queryParams.entrySet().stream()
                .collect(toMap(Entry::getKey, e -> e.getValue().get(0)));

        return ReflectionUtils.newInstanceAndSetFieldValues(clazz, fieldValues);
    }
@Test
    void testToRequestUrlWithQueryParams() {
        RequestUrl requestUrl = new MatchUrl("/api/jobs/enqueued?offset=2&limit=2&order=updatedAt:DESC").toRequestUrl("/api/jobs/:state");
        OffsetBasedPageRequest pageRequest = requestUrl.fromQueryParams(OffsetBasedPageRequest.class);
        assertThat(pageRequest.getOffset()).isEqualTo(2);
        assertThat(pageRequest.getLimit()).isEqualTo(2);
        assertThat(pageRequest.getOrder()).isEqualTo("updatedAt:DESC");
    }