static void checkFlags(String flags) {
        Set<Character> allowedChars = Set.of('s','i','x','m');
         boolean isValidFlag= flags.chars()
                .mapToObj(c -> (char) c)
                .allMatch(allowedChars::contains)
                && flags.chars()
                .mapToObj(c -> (char) c)
                .collect(Collectors.toSet())
                .size() == flags.length();
         if(!isValidFlag){
             throw new IllegalArgumentException("Not a valid flag parameter " +flags);
         }
    }
@Test
    void checkFlagsTest() {
        assertDoesNotThrow(() -> MatchesFunction.checkFlags("s"));
        assertDoesNotThrow(() -> MatchesFunction.checkFlags("i"));
        assertDoesNotThrow(() -> MatchesFunction.checkFlags("sx"));
        assertDoesNotThrow(() -> MatchesFunction.checkFlags("six"));
        assertDoesNotThrow(() -> MatchesFunction.checkFlags("sixm"));
        assertThrows(IllegalArgumentException.class, () -> MatchesFunction.checkFlags("a"));
        assertThrows(IllegalArgumentException.class, () -> MatchesFunction.checkFlags("sa"));
        assertThrows(IllegalArgumentException.class, () -> MatchesFunction.checkFlags("siU@"));
        assertThrows(IllegalArgumentException.class, () -> MatchesFunction.checkFlags("siUxU"));
        assertThrows(IllegalArgumentException.class, () -> MatchesFunction.checkFlags("ss"));
        assertThrows(IllegalArgumentException.class, () -> MatchesFunction.checkFlags("siiU"));
        assertThrows(IllegalArgumentException.class, () -> MatchesFunction.checkFlags("si U"));
        assertThrows(IllegalArgumentException.class, () -> MatchesFunction.checkFlags("U"));
    }