JBBPFieldArrayBoolean extends JBBPAbstractArrayField<JBBPFieldBoolean> implements JBBPNumericArray { @Override public JBBPFieldBoolean getElementAt(final int index) { final JBBPFieldBoolean result = new JBBPFieldBoolean(this.fieldNameInfo, getAsBool(index)); result.payload = this.payload; return result; } 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 testGetElementAt() { final boolean[] etalon = new boolean[] {true, false, true, true, false}; final Serializable payload = new FakePayload(); test.setPayload(payload); for (int i = 0; i < etalon.length; i++) { final JBBPFieldBoolean f = test.getElementAt(i); assertSame(payload, f.getPayload()); assertEquals(etalon[i], f.getAsBool()); } }