关于HashMap的get问题

public V get(Object key) {
    HashMap.Node<K,V> e;
    return (e = getNode(hash(key), key)) == null ? null : e.value;
}
final HashMap.Node<K,V> getNode(int hash, Object key) {
    HashMap.Node<K,V>[] tab; HashMap.Node<K,V> first, e; int n; K k;
    // 判断数组是否为null,索引处的第一个元素(头节点)是否为null
    if ((tab = table) != null && (n = tab.length) > 0 &&
            (first = tab[(n - 1) & hash]) != null) {
        // 检查头节点是否是要查询的节点:key的hash值相等并且key的内容也相等则命中,始终都是根据key来查询
        if (first.hash == hash && // always check first node
                ((k = first.key) == key || (key != null && key.equals(k))))
            return first;
        // 头节点不是要查询的节点,接着检查后面的节点
        if ((e = first.next) != null) {
            // 链表已经成为了红黑树
            if (first instanceof HashMap.TreeNode)
                return ((HashMap.TreeNode<K,V>)first).getTreeNode(hash, key);
            // 还是链表,则遍历链表
            do {
                // 一条链表上的hash值或者一棵树上的hash值不都是一样的吗,为什么还要比较hash值?
                if (e.hash == hash &&
                        ((k = e.key) == key || (key != null && key.equals(k))))
                    return e;
            } while ((e = e.next) != null);
        }
    }
    return null;
}

请问:为什么已经根据key的hash值定位到了索引,后面还需要与链表或者红黑树中的key的hash值进行比较,该索引后面的节点的hash值不都是相等的吗?谢谢

有些特殊的情况下,hash值不同,也能被放到同一个链表中,
假设有两个key,hash值是1和17,hashmap的初始容量是16,这时候
15 & 1 和 15 & 17 结果都是1 - -

谢谢