String generate(String sentence) {
        if (sentence.isEmpty()) {
            throw new IllegalArgumentException("Cannot create function name from empty sentence");
        }

        List<String> words = Stream.of(sentence)
                .map(this::replaceIllegalCharacters)
                .map(String::trim)
                .flatMap(SPLIT_WHITESPACE::splitAsStream)
                .flatMap(SPLIT_CAMEL_CASE::splitAsStream)
                .flatMap(SPLIT_UNDERSCORE::splitAsStream)
                .collect(Collectors.toList());

        return joiner.concatenate(words);
    }
@Test
    void testSanitizeEmptyFunctionName() {
        Executable testMethod = () -> snakeCase.generate("");
        IllegalArgumentException expectedThrown = assertThrows(IllegalArgumentException.class, testMethod);
        assertThat(expectedThrown.getMessage(), is(equalTo("Cannot create function name from empty sentence")));
    }