class NegativeSampleProducer {

    public long nextSample() {
        long index = contextNodeDistribution.binarySearch(ThreadLocalRandom.current().nextLong(cumulativeProbability));

        if (index < contextNodeDistribution.size() - 1) {
            index++;
        }

        return index;
    }

    public  NegativeSampleProducer(
        HugeLongArray contextNodeDistribution
    );

}