### Question:
CorbaObjectWriter { public void writeArray(CorbaArrayHandler arrayHandler) throws CorbaBindingException { List<CorbaObjectHandler> arrayElements = arrayHandler.getElements(); for (int i = 0; i < arrayElements.size(); ++i) { this.write(arrayElements.get(i)); } } CorbaObjectWriter(OutputStream outStream); void write(CorbaObjectHandler obj); void writeBoolean(Boolean b); void writeChar(Character c); void writeWChar(Character c); void writeOctet(Byte b); void writeShort(Short s); void writeUShort(Integer s); void writeLong(Integer l); void writeULong(Long l); void writeLongLong(Long l); void writeULongLong(java.math.BigInteger l); void writeFloat(Float f); void writeDouble(Double d); void writeString(String s); void writeWString(String s); void writeAny(CorbaAnyHandler anyHandler); void writeEnum(CorbaEnumHandler enumHandler); void writeStruct(CorbaStructHandler structHandler); void writeException(CorbaExceptionHandler exHandler); void writeFixed(CorbaFixedHandler fixedHandler); void writeUnion(CorbaObjectHandler obj); void writeArray(CorbaArrayHandler arrayHandler); void writeSequence(CorbaObjectHandler obj); void writeObjectReference(CorbaObjectReferenceHandler objHandler);  }### Answer:
@Test public void testWriteArray() { int[] data = {1, 1, 2, 3, 5, 8, 13, 21}; QName longIdlType = new QName(CorbaConstants.NU_WSDL_CORBA, "long", CorbaConstants.NP_WSDL_CORBA); QName arrayIdlType = new QName(CorbaConstants.NU_WSDL_CORBA, "array", CorbaConstants.NP_WSDL_CORBA); Array arrayType = new Array(); arrayType.setBound(data.length); arrayType.setElemtype(longIdlType); TypeCode arrayTC = orb.create_array_tc(data.length, orb.get_primitive_tc(TCKind.tk_long)); CorbaArrayHandler obj = new CorbaArrayHandler(new QName("Array"), arrayIdlType, arrayTC, arrayType); for (int i = 0; i < data.length; ++i) { CorbaPrimitiveHandler nestedObj = new CorbaPrimitiveHandler(new QName("item"), longIdlType, orb.get_primitive_tc(TCKind.tk_long), null); nestedObj.setValueFromData(Integer.toString(data[i])); obj.addElement(nestedObj); } OutputStream oStream = orb.create_output_stream(); CorbaObjectWriter writer = new CorbaObjectWriter(oStream); writer.writeArray(obj); InputStream iStream = oStream.create_input_stream(); for (int i = 0; i < data.length; ++i) { int val = iStream.read_long(); assertTrue(val == data[i]); } }