JBBPFieldArrayStruct extends JBBPAbstractArrayField<JBBPFieldStruct> { @Override public Object getValueArrayAsObject(final boolean reverseBits) { return this.structs.clone(); } JBBPFieldArrayStruct(final JBBPNamedFieldInfo name, final JBBPFieldStruct[] array); JBBPFieldStruct[] getArray(); @Override int size(); @Override JBBPFieldStruct getElementAt(final int index); @Override Object getValueArrayAsObject(final boolean reverseBits); @Override String getTypeAsString();  }
@Test public void testGetValueArrayAsObject() throws Exception { final Object resultForFalse = test.getValueArrayAsObject(false); final Object resultForTrue = test.getValueArrayAsObject(true); assertNotSame(test.getArray(), resultForFalse); assertNotSame(test.getArray(), resultForTrue); assertNotSame(resultForTrue, resultForFalse); assertArrayEquals((Object[]) resultForTrue, test.getArray()); assertArrayEquals((Object[]) resultForTrue, (Object[]) resultForFalse); }