@Override
    public int hashCode() {
        if (hashCode == 0) { // Lazy initialize
            hashCode = Arrays.hashCode(bytes);
        }
        return hashCode;
    }
Can use it as a map key,

@author jiachun.fjc
jraft-rheakv/rheakv-core/src/main/java/com/alipay/sofa/jraft/rhea/util/ByteArray.java