JBBPFieldArrayString extends JBBPAbstractArrayField<JBBPFieldString> { @Override public JBBPFieldString getElementAt(final int index) { final JBBPFieldString result = new JBBPFieldString(this.fieldNameInfo, this.array[index]); result.payload = this.payload; return result; } JBBPFieldArrayString(final JBBPNamedFieldInfo name, final String[] array); String[] getArray(); @Override int size(); @Override JBBPFieldString getElementAt(final int index); @Override Object getValueArrayAsObject(final boolean reverseBits); @Override String getTypeAsString();  }
@Test public void testGetElementAt() { final String[] etalon = new String[] {"012",null,"ABC"}; final Serializable payload = new FakePayload(); test.setPayload(payload); for (int i = 0; i < etalon.length; i++) { final JBBPFieldString f = test.getElementAt(i); assertSame(payload, f.getPayload()); assertEquals(etalon[i], f.getAsString()); } }