@Test
public void testControlNoCriticalEmptyDataSerialization() throws IOException, ClassNotFoundException
{
LdifControl ldifControl1 = new LdifControl( controlNoCriticalEmptyData.getOid() );
ldifControl1.setCritical( controlNoCriticalEmptyData.isCritical() );
ldifControl1.setValue( ( ( OpaqueControl ) controlNoCriticalEmptyData ).getEncodedValue() );
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ObjectOutputStream out = new ObjectOutputStream( baos );
ldifControl1.writeExternal( out );
ObjectInputStream in = null;
byte[] data = baos.toByteArray();
in = new ObjectInputStream( new ByteArrayInputStream( data ) );
LdifControl ldifControl2 = new LdifControl();
ldifControl2.readExternal( in );
assertEquals( ldifControl1, ldifControl2 );
}