[java] How do I count the number of occurrences of a char in a String?