public static void testCopyHeaders() {
Message m1=new Message(null, null, "hello");
for(short id: new short[]{1, 2, 10, Global.BLOCKS_START_ID, Global.BLOCKS_START_ID +10}) {
m1.putHeader(id, new DummyHeader(id));
}
System.out.println("Headers for m1: " + m1.printHeaders());
Message m2=m1.copy(true, Global.BLOCKS_START_ID);
System.out.println("Headers for m2: " + m2.printHeaders());
Map<Short,Header> hdrs=m2.getHeaders();
assert hdrs.size() == 2;