JBBPFieldArrayLong extends JBBPAbstractArrayField<JBBPFieldLong> implements JBBPNumericArray { @Override public JBBPFieldLong getElementAt(final int index) { final JBBPFieldLong result = new JBBPFieldLong(this.fieldNameInfo, this.array[index]); result.payload = this.payload; return result; } JBBPFieldArrayLong(final JBBPNamedFieldInfo name, final long[] array); long[] getArray(); @Override int size(); @Override JBBPFieldLong 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 long[] etalon = new long[] {-278349872364L, 12223423987439324L, 0L, -2782346872343L, 37238468273412L}; final Serializable payload = new FakePayload(); test.setPayload(payload); for (int i = 0; i < etalon.length; i++) { final JBBPFieldLong f = test.getElementAt(i); assertSame(payload, f.getPayload()); assertEquals(etalon[i], f.getAsLong()); } }