public int fairSelectNextIndexOutOf2(int availableInputsMask, int lastReadInputIndex) {
        return fairSelectNextIndexOutOf2((int) inputMask, availableInputsMask, lastReadInputIndex);
    }
@Test
    void testFairSelectNextIndexOutOf2() {
        assertThat(InputSelection.ALL.fairSelectNextIndexOutOf2(3, 0)).isOne();
        assertThat(new Builder().select(1).select(2).build().fairSelectNextIndexOutOf2(3, 1))
                .isZero();

        assertThat(InputSelection.ALL.fairSelectNextIndexOutOf2(2, 0)).isOne();
        assertThat(InputSelection.ALL.fairSelectNextIndexOutOf2(2, 1)).isOne();
        assertThat(InputSelection.ALL.fairSelectNextIndexOutOf2(1, 0)).isZero();
        assertThat(InputSelection.ALL.fairSelectNextIndexOutOf2(1, 1)).isZero();
        assertThat(InputSelection.ALL.fairSelectNextIndexOutOf2(0, 0))
                .isEqualTo(InputSelection.NONE_AVAILABLE);
        assertThat(InputSelection.ALL.fairSelectNextIndexOutOf2(0, 1))
                .isEqualTo(InputSelection.NONE_AVAILABLE);

        assertThat(InputSelection.FIRST.fairSelectNextIndexOutOf2(1, 0)).isZero();
        assertThat(InputSelection.FIRST.fairSelectNextIndexOutOf2(3, 0)).isZero();
        assertThat(InputSelection.FIRST.fairSelectNextIndexOutOf2(2, 0))
                .isEqualTo(InputSelection.NONE_AVAILABLE);
        assertThat(InputSelection.FIRST.fairSelectNextIndexOutOf2(0, 0))
                .isEqualTo(InputSelection.NONE_AVAILABLE);

        assertThat(InputSelection.SECOND.fairSelectNextIndexOutOf2(2, 1)).isOne();
        assertThat(InputSelection.SECOND.fairSelectNextIndexOutOf2(3, 1)).isOne();
        assertThat(InputSelection.SECOND.fairSelectNextIndexOutOf2(1, 1))
                .isEqualTo(InputSelection.NONE_AVAILABLE);
        assertThat(InputSelection.SECOND.fairSelectNextIndexOutOf2(0, 1))
                .isEqualTo(InputSelection.NONE_AVAILABLE);
    }