static String generateClassName(final OpenAPI document) {
        final Info info = document.getInfo();
        if (info == null) {
            return DEFAULT_CLASS_NAME;
        }

        final String title = info.getTitle();
        if (title == null) {
            return DEFAULT_CLASS_NAME;
        }

        final String className = title.chars().filter(Character::isJavaIdentifierPart).filter(c -> c < 'z').boxed()
                .collect(Collector.of(StringBuilder::new, StringBuilder::appendCodePoint, StringBuilder::append,
                        StringBuilder::toString));

        if (className.isEmpty() || !Character.isJavaIdentifierStart(className.charAt(0))) {
            return DEFAULT_CLASS_NAME;
        }

        return className;
    }
@Test
    public void shouldUseDefaultClassNameIfInfoOrTitleIsNotPresent() {
        final OpenAPI openapi = new OpenAPI();

        assertThat(RestDslSourceCodeGenerator.generateClassName(openapi))
                .isEqualTo(RestDslSourceCodeGenerator.DEFAULT_CLASS_NAME);

        openapi.setInfo(new Info());
        assertThat(RestDslSourceCodeGenerator.generateClassName(openapi))
                .isEqualTo(RestDslSourceCodeGenerator.DEFAULT_CLASS_NAME);
    }