JBBPFieldArrayBit extends JBBPAbstractArrayField<JBBPFieldBit> implements BitEntity, JBBPNumericArray { @Override public boolean getAsBool(final int index) { return this.array[index] != 0; } JBBPFieldArrayBit(final JBBPNamedFieldInfo name, final byte[] array, final JBBPBitNumber bitNumber); byte[] getArray(); @Override JBBPBitNumber getBitWidth(); @Override int size(); @Override JBBPFieldBit 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 testGetAsBool() { final boolean[] etalon = new boolean[] {true, false, true, true, true}; for (int i = 0; i < etalon.length; i++) { assertEquals(etalon[i], test.getAsBool(i)); } }