public void testCombinedPackets() throws Exception {
		clientEngine.beginHandshake();
		
		CalledMethod m;
		ByteBuffer b;
		
		CalledMethod m1 = clientList.expect("packetEncrypted");
		ByteBuffer b3 = (ByteBuffer)m1.getAllParams()[0];
		serverEngine.feedEncryptedPacket(b3, null);
		
		m = serverList.expect("runTask");		
		Runnable r = (Runnable)m.getAllParams()[0];
		r.run();
		
		m = serverList.expect("packetEncrypted");
		b = (ByteBuffer)m.getAllParams()[0];
		clientEngine.feedEncryptedPacket(b, null);
		
		m = clientList.expect("runTask");		
		r = (Runnable)m.getAllParams()[0];
		r.run();
		
		String[] methodNames = new String[3];
		methodNames[0] = "packetEncrypted";
		methodNames[1] = "packetEncrypted";
		methodNames[2] = "packetEncrypted";
		CalledMethod[] methods = clientList.expect(methodNames);
		
		ByteBuffer b0 = (ByteBuffer)methods[0].getAllParams()[0];
		ByteBuffer b1 = (ByteBuffer)methods[1].getAllParams()[0];
		ByteBuffer b2 = (ByteBuffer)methods[2].getAllParams()[0];
		
		int total = b0.remaining()+b1.remaining()+b2.remaining();
		ByteBuffer combined = ByteBuffer.allocate(total);
		combined.put(b0);
		combined.put(b1);
		combined.put(b2);
		helper.doneFillingBuffer(combined);
		serverEngine.feedEncryptedPacket(combined, null);		

		m = serverList.expect("runTask");		
		r = (Runnable)m.getAllParams()[0];
		r.run();
		
		methodNames = new String[3];
		methodNames[0] = "packetEncrypted";
		methodNames[1] = "packetEncrypted";
		methodNames[2] = "encryptedLinkEstablished";
		methods = serverList.expect(methodNames);

		b0 = (ByteBuffer)methods[0].getAllParams()[0];
		b1 = (ByteBuffer)methods[1].getAllParams()[0];
		total = b0.remaining()+b1.remaining();
		combined = ByteBuffer.allocate(total);
		combined.put(b0);
		combined.put(b1);		
		helper.doneFillingBuffer(combined);

		clientEngine.feedEncryptedPacket(combined, null);
		
		clientList.expect("encryptedLinkEstablished");		
	}