JBBPFieldArrayBoolean extends JBBPAbstractArrayField<JBBPFieldBoolean> implements JBBPNumericArray { @Override public int getAsInt(final int index) { return this.array[index] ? 1 : 0; } JBBPFieldArrayBoolean(final JBBPNamedFieldInfo name, final boolean[] array); boolean[] getArray(); @Override int size(); @Override JBBPFieldBoolean getElementAt(final int index); @Override int getAsInt(final int index); @Override long getAsLong(final int index); @Override boolean getAsBool(final int index); @Override Object getValueArrayAsObject(final boolean reverseBits); @Override String getTypeAsString();  }
@Test public void testGetAsInt() { final int[] etalon = new int[] {1, 0, 1, 1, 0}; for (int i = 0; i < etalon.length; i++) { assertEquals(etalon[i], test.getAsInt(i)); } }