### Question:
CorbaObjectReader { public void readEnum(CorbaObjectHandler obj) throws CorbaBindingException { int enumIndex = stream.read_long(); Enum enumType = (Enum) obj.getType(); List<Enumerator> enumerators = enumType.getEnumerator(); CorbaEnumHandler enumObj = (CorbaEnumHandler)obj; enumObj.setValue(enumerators.get(enumIndex).getValue()); } CorbaObjectReader(InputStream inStream); void read(CorbaObjectHandler obj); Boolean readBoolean(); Character readChar(); Character readWChar(); Byte readOctet(); Short readShort(); Integer readUShort(); Integer readLong(); long readULong(); Long readLongLong(); BigInteger readULongLong(); Float readFloat(); Double readDouble(); String readString(); String readWString(); Any readAny(); void readEnum(CorbaObjectHandler obj); void readStruct(CorbaStructHandler structObj); void readException(CorbaExceptionHandler exceptObj); void readFixed(CorbaFixedHandler fixedHandler); void readEnumDiscriminator(CorbaUnionHandler unionHandler, CorbaEnumHandler disc); void readUnion(CorbaUnionHandler unionHandler); void readArray(CorbaArrayHandler arrayObj); void readSequence(CorbaObjectHandler obj); void readObjectReference(CorbaObjectReferenceHandler objRefObj);  }### Answer:
@Test public void testReadEnum() { OutputStream oStream = orb.create_output_stream(); oStream.write_long(1); InputStream iStream = oStream.create_input_stream(); CorbaObjectReader reader = new CorbaObjectReader(iStream); String[] enums = {"RED", "GREEN", "BLUE" }; Enum enumType = new Enum(); Enumerator enumRed = new Enumerator(); enumRed.setValue(enums[0]); Enumerator enumGreen = new Enumerator(); enumGreen.setValue(enums[1]); Enumerator enumBlue = new Enumerator(); enumBlue.setValue(enums[2]); enumType.getEnumerator().add(enumRed); enumType.getEnumerator().add(enumGreen); enumType.getEnumerator().add(enumBlue); QName enumName = new QName("TestEnum"); QName enumIdlType = new QName("corbatm:TestEnum"); TypeCode enumTC = orb.create_enum_tc("IDL:TestEnum:1.0", enumName.getLocalPart(), enums); CorbaEnumHandler obj = new CorbaEnumHandler(enumName, enumIdlType, enumTC, enumType); reader.readEnum(obj); assertEquals(obj.getValue(), enums[1]); }