void main() {
    String text = "the quick brown fox jumps over the lazy dog the end";
    Map<String, Integer> counts = new LinkedHashMap<>();

    for (String word : text.split(" ")) {
        counts.put(word, counts.getOrDefault(word, 0) + 1);
    }

    IO.println(counts.get("the"));
    IO.println(counts);
}

// From Groundwork, chapter 9 (ch09-maps-and-sets), box 10.
// This example is from Groundwork, licensed CC BY-NC-SA 4.0.
// Run with: java ch09_10.java
