#fixed code
                                public HeaderDigest getLastHd() {
        List<HeaderDigest> list = new ArrayList<>(headerDigestList);
        if (list.size() > 0) {
            return list.get(list.size() - 1);
        }
        return null;
    }
#vulnerable code 
                                public HeaderDigest getLastHd() {
        if (null == lastHd) {
            List<HeaderDigest> list = new ArrayList<>(headerDigestList);
            if(list.size() > 0) {
                this.lastHd = list.get(list.size() - 1);
            }
        }
        return lastHd;
    } 
                            #location 5 
                            #vulnerability type THREAD_SAFETY_VIOLATION