Whether CSS class selectors are case sensitive by default depends on the doctype. This can be overridden by using the caseSensitiveClassSelectors QuirksSettings property.

config.setQuirksSettings(new QuirksSettings().setCaseSensitiveClassSelectors(QuirksMode.STANDARDS));