JBBPFieldArrayString extends JBBPAbstractArrayField<JBBPFieldString> { @Override public Object getValueArrayAsObject(final boolean reverseBits) { final String[] result = this.array.clone(); if (reverseBits) { for (int i = 0; i < result.length; i++) { result[i] = JBBPFieldString.reverseBits(result[i]); } } 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 testGetValueArrayAsObject() { assertArrayEquals(array, (String[]) test.getValueArrayAsObject(false)); final String[] inverted = (String[]) test.getValueArrayAsObject(true); assertEquals(array.length, inverted.length); for (int i = 0; i < array.length; i++) { assertEquals(JBBPFieldString.reverseBits(array[i]), inverted[i]); } }