@@ -91,8 +91,6 @@ public void testMultipleHeaders() throws IOException, CoapException {
9191 hdr .setUriHost ("uri-host" );
9292 hdr .setUriPort (5683 );
9393 hdr .setUriQuery ("par1=dupa&par2=dupa2" );
94- hdr .setEcho (decodeHex ("0102030405060708090a" ));
95- hdr .setRequestTag (Opaque .of ("tag-0001" ));
9694 hdr .put (36 , Opaque .variableUInt ((1357 )));
9795
9896 ByteArrayOutputStream baos = new ByteArrayOutputStream ();
@@ -105,6 +103,8 @@ public void testMultipleHeaders() throws IOException, CoapException {
105103 System .out .println (hdr2 );
106104 assertTrue (hdr .equals (hdr2 ));
107105
106+ // duplicate
107+ assertEquals (hdr , hdr .duplicate ());
108108 }
109109
110110 @ Test
@@ -171,13 +171,17 @@ public void testMultipleExHeaders() throws IOException, CoapException {
171171 hdr .setBlock1Req (new BlockOption (2 , BlockSize .S_16 , true ));
172172 hdr .setBlock2Res (new BlockOption (4 , BlockSize .S_1024 , false ));
173173 hdr .setObserve (4321 );
174+ hdr .setEcho (decodeHex ("0102030405060708090a" ));
175+ hdr .setRequestTag (Opaque .of ("tag-0001" ));
174176
175177 HeaderOptions hdr2 = deserialize (serialize (hdr ));
176178
177179 System .out .println (hdr );
178180 System .out .println (hdr2 );
179- assertTrue (hdr . equals ( hdr2 ) );
181+ assertEquals (hdr , hdr2 );
180182
183+ // duplicate
184+ assertEquals (hdr , hdr .duplicate ());
181185 }
182186
183187 @ Test
0 commit comments