Q:

HashMap not adding all keys

I am adding strings to a HashMap<String, ChartSeries> but it doesn't add all the strings. It does however change the size integer of the hashmap:

As you can see it says size:6 but when you look into the table it only holds 4 objects.
This is my code:
for (CaseTypeActivationAmount CTAM : caseTypeActivationAmounts) {
    ChartSeries cs;
    if (!caseTypes.containsKey(CTAM.getOmschrijving())) {
        if (CTAM.getOmschrijving() != null) {
            cs = new ChartSeries(CTAM.getOmschrijving());
        } else {
            cs = new ChartSeries(" ");
        }

        caseTypes.put(CTAM.getOmschrijving(), cs);
    } else {
        cs = caseTypes.get(CTAM.getOmschrijving());
    }
    DateFormat dateFormat = new SimpleDateFormat("dd/MM/yy");
    cs.set(dateFormat.format(CTAM.getDate()), CTAM.getAmount());
}

Am I missing something? 

A:

when you look into the table it only holds 4 objects.

The table does hold six objects. However, due to hash collisions, it holds them in only four separate chains.
You can see what's going on in the debugger: open the value of each node, and examine the next value. You will find that either (1) two of the six nodes have a second item, or (2) one of the six nodes has two additional items in its chain, for the overall count of six objects.

