Sapient interview question

Java 8 features, Java 17 features, count the characters in a string