private static double calculateJaccardIndex(int alen, int blen, int union) {
        double overlap = alen +  blen - union;
        if( overlap <= 0 )
            return 0.0;
        return overlap / union;
    }