List<Ticket> tickets = new ArrayList<Ticket>();
tickets.add( t1 );
tickets.add( t2 );
KrbCred expected = new KrbCred();
expected.setTickets( tickets );
expected.setEncPart( encPart );
int krbCredLen = expected.computeLength();
ByteBuffer stream = ByteBuffer.allocate( krbCredLen );
expected.encode( stream );
stream.flip();
KrbCredContainer container = new KrbCredContainer( stream );
Asn1Decoder decoder = new Asn1Decoder();
decoder.decode( stream, container );
KrbCred actual = container.getKrbCred();
assertEquals( expected.getProtocolVersionNumber(), actual.getProtocolVersionNumber() );
assertEquals( expected.getMessageType(), actual.getMessageType() );
assertEquals( expected.getTickets(), actual.getTickets() );
assertEquals( expected.getEncPart(), actual.getEncPart() );
}