public Result check(IndexSetTemplate indexSetTemplate) {
        return indexSetTemplateRequirements.stream()
                .sorted(Comparator.comparing(IndexSetTemplateRequirement::priority))
                .map(indexSetTemplateRequirement -> indexSetTemplateRequirement.check(indexSetTemplate))
                .filter(result -> !result.fulfilled())
                .findFirst()
                .orElse(new Result(true, ""));
    }
@Test
    void testRequirement1NotFulfilled() {
        Result expectedResult = new Result(false, "r1");
        when(requirement1.check(any())).thenReturn(expectedResult);

        Result result = underTest.check(indexSetTemplate);

        assertThat(result).isEqualTo(expectedResult);
        requirements.verify(requirement1).check(any());
        requirements.verify(requirement2, never()).check(any());
    }