private static IntArray toIndexArray(long[] supportA, long[] supportB, IntArray indices) { if (indices == null) { indices = new IntArray(); } else { indices.clear(); } for (int i = 0; i < supportA.length; i++) { long commonSupport = supportA[i] & supportB[i]; while (commonSupport != 0) { final int index = Long.numberOfTrailingZeros(commonSupport); indices.add(index + i * 64); commonSupport ^= (1L << index); } } return indices; }