public static int count(final byte[] bits, final int start, final int end) {
		if (end - start <= Byte.SIZE) {
			int count = 0;
			for (int i = start; i < end; ++i) {
				if (get(bits, i)) {
					++count;
				}
			}
			return count;
		}

		final int byteStart = start/Byte.SIZE + 1;
		final int byteEnd = end/Byte.SIZE;

		int count = 0;
		for (int i = byteStart; i < byteEnd; ++i) {
			count += count(bits[i]);
		}

		for (int i = start, n = byteStart*Byte.SIZE; i < n; ++i) {
			if (get(bits, i)) {
				++count;
			}
		}
		for (int i = byteEnd*8; i < end; ++i) {
			if (get(bits, i)) {
				++count;
			}
		}

		return count;
	}
Returns the number of one-bits in the given {@code byte[]} array.

@param bits the bit values of the new chromosome gene.
@param start the initial (bit) index of the range to be copied, inclusive
@param end the final (bit) index of the range to be copied, exclusive.
       (This index may lie outside the array.)
@return the number of one-bits in the given {@code byte} array.
jenetics/src/main/java/io/jenetics/internal/util/Bits.java