class InputSelection implements Serializable {

	public int fairSelectNextIndex(long availableInputsMask, int lastReadInputIndex) {
		long combineMask = availableInputsMask & inputMask;

		if (combineMask == 0) {
			return NONE_AVAILABLE;
		}

		int nextReadInputIndex = selectFirstBitRightFromNext(combineMask, lastReadInputIndex + 1);
		if (nextReadInputIndex >= 0) {
			return nextReadInputIndex;
		}
		return selectFirstBitRightFromNext(combineMask, 0);
	}

	private  InputSelection(long inputMask);

}