#fixed code
                                @Override
    public void unsubscribed(int id, Subscription s) {
        if(subscriptionsBCM.contains(s)) {
            safeUnsubscribe(id);
        } else {
            logger.log(Level.WARNING, "Unregistered subscription tried to unsubscribe!");
        }
    }
#vulnerable code 
                                @Override
    public void unsubscribed(int id, Subscription s) {
        if(subscriptionsBCM.contains(s)) {
            safeUnsubscribe(id);
        }
    } 
                            #location 4 
                            #vulnerability type THREAD_SAFETY_VIOLATION