code: @Test public void testInvalidConstructor(){
    ByteArrayOutputStream baos=new ByteArrayOutputStream();
    WritableByteChannel channel=newChannel(baos);
    HttpParams params=new BasicHttpParams();
    SessionOutputBuffer outbuf=new SessionOutputBufferImpl(1024,128,params);
    try {
      new IdentityEncoder(null,null,null);
      Assert.fail("IllegalArgumentException should have been thrown");
    }
   catch (  IllegalArgumentException ex) {
    }
    try {
      new IdentityEncoder(channel,null,null);
      Assert.fail("IllegalArgumentException should have been thrown");
    }
   catch (  IllegalArgumentException ex) {
    }
    try {
      new IdentityEncoder(channel,outbuf,null);
      Assert.fail("IllegalArgumentException should have been thrown");
    }
   catch (  IllegalArgumentException ex) {
    }
  }
  