1818
1919import static org .junit .jupiter .api .Assertions .assertEquals ;
2020import static org .junit .jupiter .api .Assertions .assertNull ;
21+ import static org .junit .jupiter .api .Assertions .assertSame ;
2122import static org .junit .jupiter .api .Assertions .assertTrue ;
2223
2324import java .nio .charset .StandardCharsets ;
@@ -44,25 +45,25 @@ void getMappingOneByte()
4445 assertEquals (CMapStrings .getMapping (minValueOneByte ),
4546 CMapStrings .getMapping (minValueOneByte ));
4647 // the given values are the same objects
47- assertTrue (
48- CMapStrings .getMapping (minValueOneByte ) == CMapStrings .getMapping (minValueOneByte ));
48+ assertSame (
49+ CMapStrings .getMapping (minValueOneByte ), CMapStrings .getMapping (minValueOneByte ));
4950 // check the mapped string value
5051 assertEquals (minValueMapping , CMapStrings .getMapping (minValueOneByte ));
5152
5253 byte [] maxValueOneByte = new byte [] { (byte ) 0xff };
5354 String maxValueMapping = new String (maxValueOneByte , StandardCharsets .ISO_8859_1 );
5455 assertEquals (CMapStrings .getMapping (maxValueOneByte ),
5556 CMapStrings .getMapping (maxValueOneByte ));
56- assertTrue (
57- CMapStrings .getMapping (maxValueOneByte ) == CMapStrings .getMapping (maxValueOneByte ));
57+ assertSame (
58+ CMapStrings .getMapping (maxValueOneByte ), CMapStrings .getMapping (maxValueOneByte ));
5859 assertEquals (maxValueMapping , CMapStrings .getMapping (maxValueOneByte ));
5960
6061 byte [] anyValueOneByte = new byte [] { 98 };
6162 String anyValueMapping = new String (anyValueOneByte , StandardCharsets .ISO_8859_1 );
6263 assertEquals (CMapStrings .getMapping (anyValueOneByte ),
6364 CMapStrings .getMapping (anyValueOneByte ));
64- assertTrue (
65- CMapStrings .getMapping (anyValueOneByte ) == CMapStrings .getMapping (anyValueOneByte ));
65+ assertSame (
66+ CMapStrings .getMapping (anyValueOneByte ), CMapStrings .getMapping (anyValueOneByte ));
6667 assertEquals (anyValueMapping , CMapStrings .getMapping (anyValueOneByte ));
6768 }
6869
@@ -75,40 +76,40 @@ void getMappingTwoByte()
7576 assertEquals (CMapStrings .getMapping (minValueTwoByte ),
7677 CMapStrings .getMapping (minValueTwoByte ));
7778 // the given values are the same objects
78- assertTrue (
79- CMapStrings .getMapping (minValueTwoByte ) == CMapStrings .getMapping (minValueTwoByte ));
79+ assertSame (
80+ CMapStrings .getMapping (minValueTwoByte ), CMapStrings .getMapping (minValueTwoByte ));
8081 // check the mapped string value
8182 assertEquals (minValueMapping , CMapStrings .getMapping (minValueTwoByte ));
8283
8384 byte [] maxValueTwoByte = new byte [] { (byte ) 0xff , (byte ) 0xff };
8485 String maxValueMapping = new String (maxValueTwoByte , StandardCharsets .UTF_16BE );
8586 assertEquals (CMapStrings .getMapping (maxValueTwoByte ),
8687 CMapStrings .getMapping (maxValueTwoByte ));
87- assertTrue (
88- CMapStrings .getMapping (maxValueTwoByte ) == CMapStrings .getMapping (maxValueTwoByte ));
88+ assertSame (
89+ CMapStrings .getMapping (maxValueTwoByte ), CMapStrings .getMapping (maxValueTwoByte ));
8990 assertEquals (maxValueMapping , CMapStrings .getMapping (maxValueTwoByte ));
9091
9192 byte [] anyValueTwoByte1 = new byte [] { 0x62 , 0x43 };
9293 String anyValueMapping1 = new String (anyValueTwoByte1 , StandardCharsets .UTF_16BE );
9394 assertEquals (CMapStrings .getMapping (anyValueTwoByte1 ),
9495 CMapStrings .getMapping (anyValueTwoByte1 ));
95- assertTrue (CMapStrings .getMapping (anyValueTwoByte1 ) == CMapStrings
96+ assertSame (CMapStrings .getMapping (anyValueTwoByte1 ), CMapStrings
9697 .getMapping (anyValueTwoByte1 ));
9798 assertEquals (anyValueMapping1 , CMapStrings .getMapping (anyValueTwoByte1 ));
9899
99100 byte [] anyValueTwoByte2 = new byte [] { (byte ) 0xff , 0x43 };
100101 String anyValueMapping2 = new String (anyValueTwoByte2 , StandardCharsets .UTF_16BE );
101102 assertEquals (CMapStrings .getMapping (anyValueTwoByte2 ),
102103 CMapStrings .getMapping (anyValueTwoByte2 ));
103- assertTrue (CMapStrings .getMapping (anyValueTwoByte2 ) == CMapStrings
104+ assertSame (CMapStrings .getMapping (anyValueTwoByte2 ), CMapStrings
104105 .getMapping (anyValueTwoByte2 ));
105106 assertEquals (anyValueMapping2 , CMapStrings .getMapping (anyValueTwoByte2 ));
106107
107108 byte [] anyValueTwoByte3 = new byte [] { 0x38 , (byte ) 0xff };
108109 String anyValueMapping3 = new String (anyValueTwoByte3 , StandardCharsets .UTF_16BE );
109110 assertEquals (CMapStrings .getMapping (anyValueTwoByte3 ),
110111 CMapStrings .getMapping (anyValueTwoByte3 ));
111- assertTrue (CMapStrings .getMapping (anyValueTwoByte3 ) == CMapStrings
112+ assertSame (CMapStrings .getMapping (anyValueTwoByte3 ), CMapStrings
112113 .getMapping (anyValueTwoByte3 ));
113114 assertEquals (anyValueMapping3 , CMapStrings .getMapping (anyValueTwoByte3 ));
114115 }
@@ -121,7 +122,7 @@ void getByteValuesOneByte()
121122 assertEquals (CMapStrings .getByteValue (minValueOneByte ),
122123 CMapStrings .getByteValue (minValueOneByte ));
123124 // the given values are the same objects
124- assertTrue (CMapStrings .getByteValue (minValueOneByte ) == CMapStrings
125+ assertSame (CMapStrings .getByteValue (minValueOneByte ), CMapStrings
125126 .getByteValue (minValueOneByte ));
126127 // the cached value isn't the same object than the given one
127128 assertTrue (minValueOneByte != CMapStrings .getByteValue (minValueOneByte ));
@@ -130,14 +131,14 @@ void getByteValuesOneByte()
130131 byte [] maxValueOneByte = new byte [] { (byte ) 0xff };
131132 assertEquals (CMapStrings .getByteValue (maxValueOneByte ),
132133 CMapStrings .getByteValue (maxValueOneByte ));
133- assertTrue (CMapStrings .getByteValue (maxValueOneByte ) == CMapStrings
134+ assertSame (CMapStrings .getByteValue (maxValueOneByte ), CMapStrings
134135 .getByteValue (maxValueOneByte ));
135136 assertTrue (maxValueOneByte != CMapStrings .getByteValue (maxValueOneByte ));
136137
137138 byte [] anyValueOneByte = new byte [] { 98 };
138139 assertEquals (CMapStrings .getByteValue (anyValueOneByte ),
139140 CMapStrings .getByteValue (anyValueOneByte ));
140- assertTrue (CMapStrings .getByteValue (anyValueOneByte ) == CMapStrings
141+ assertSame (CMapStrings .getByteValue (anyValueOneByte ), CMapStrings
141142 .getByteValue (anyValueOneByte ));
142143 assertTrue (anyValueOneByte != CMapStrings .getByteValue (anyValueOneByte ));
143144 }
@@ -150,36 +151,36 @@ void getByteValuesTwoByte()
150151 assertEquals (CMapStrings .getByteValue (minValueTwoByte ),
151152 CMapStrings .getByteValue (minValueTwoByte ));
152153 // the given values are the same objects
153- assertTrue (CMapStrings .getByteValue (minValueTwoByte ) == CMapStrings
154+ assertSame (CMapStrings .getByteValue (minValueTwoByte ), CMapStrings
154155 .getByteValue (minValueTwoByte ));
155156 // the cached value isn't the same object than the given one
156157 assertTrue (minValueTwoByte != CMapStrings .getByteValue (minValueTwoByte ));
157158
158159 byte [] maxValueTwoByte = new byte [] { (byte ) 0xff , (byte ) 0xff };
159160 assertEquals (CMapStrings .getByteValue (maxValueTwoByte ),
160161 CMapStrings .getByteValue (maxValueTwoByte ));
161- assertTrue (CMapStrings .getByteValue (maxValueTwoByte ) == CMapStrings
162+ assertSame (CMapStrings .getByteValue (maxValueTwoByte ), CMapStrings
162163 .getByteValue (maxValueTwoByte ));
163164 assertTrue (maxValueTwoByte != CMapStrings .getByteValue (maxValueTwoByte ));
164165
165166 byte [] anyValueTwoByte1 = new byte [] { 0x62 , 0x43 };
166167 assertEquals (CMapStrings .getByteValue (anyValueTwoByte1 ),
167168 CMapStrings .getByteValue (anyValueTwoByte1 ));
168- assertTrue (CMapStrings .getByteValue (anyValueTwoByte1 ) == CMapStrings
169+ assertSame (CMapStrings .getByteValue (anyValueTwoByte1 ), CMapStrings
169170 .getByteValue (anyValueTwoByte1 ));
170171 assertTrue (anyValueTwoByte1 != CMapStrings .getByteValue (anyValueTwoByte1 ));
171172
172173 byte [] anyValueTwoByte2 = new byte [] { (byte ) 0xff , 0x43 };
173174 assertEquals (CMapStrings .getByteValue (anyValueTwoByte2 ),
174175 CMapStrings .getByteValue (anyValueTwoByte2 ));
175- assertTrue (CMapStrings .getByteValue (anyValueTwoByte2 ) == CMapStrings
176+ assertSame (CMapStrings .getByteValue (anyValueTwoByte2 ), CMapStrings
176177 .getByteValue (anyValueTwoByte2 ));
177178 assertTrue (anyValueTwoByte2 != CMapStrings .getByteValue (anyValueTwoByte2 ));
178179
179180 byte [] anyValueTwoByte3 = new byte [] { 0x38 , (byte ) 0xff };
180181 assertEquals (CMapStrings .getByteValue (anyValueTwoByte3 ),
181182 CMapStrings .getByteValue (anyValueTwoByte3 ));
182- assertTrue (CMapStrings .getByteValue (anyValueTwoByte3 ) == CMapStrings
183+ assertSame (CMapStrings .getByteValue (anyValueTwoByte3 ), CMapStrings
183184 .getByteValue (anyValueTwoByte3 ));
184185 assertTrue (anyValueTwoByte3 != CMapStrings .getByteValue (anyValueTwoByte3 ));
185186 }
@@ -200,22 +201,22 @@ void getIndexValuesOneByte()
200201 assertEquals (CMapStrings .getIndexValue (minValueOneByte ),
201202 CMapStrings .getIndexValue (minValueOneByte ));
202203 // the given values are the same objects
203- assertTrue (CMapStrings .getIndexValue (minValueOneByte ) == CMapStrings
204+ assertSame (CMapStrings .getIndexValue (minValueOneByte ), CMapStrings
204205 .getIndexValue (minValueOneByte ));
205206 // check the int value
206207 assertEquals (0 , CMapStrings .getIndexValue (minValueOneByte ));
207208
208209 byte [] maxValueOneByte = new byte [] { (byte ) 0xff };
209210 assertEquals (CMapStrings .getIndexValue (maxValueOneByte ),
210211 CMapStrings .getIndexValue (maxValueOneByte ));
211- assertTrue (CMapStrings .getIndexValue (maxValueOneByte ) == CMapStrings
212+ assertSame (CMapStrings .getIndexValue (maxValueOneByte ), CMapStrings
212213 .getIndexValue (maxValueOneByte ));
213214 assertEquals (0xff , CMapStrings .getIndexValue (maxValueOneByte ));
214215
215216 byte [] anyValueOneByte = new byte [] { 98 };
216217 assertEquals (CMapStrings .getIndexValue (anyValueOneByte ),
217218 CMapStrings .getIndexValue (anyValueOneByte ));
218- assertTrue (CMapStrings .getIndexValue (anyValueOneByte ) == CMapStrings
219+ assertSame (CMapStrings .getIndexValue (anyValueOneByte ), CMapStrings
219220 .getIndexValue (anyValueOneByte ));
220221 assertEquals (98 , CMapStrings .getIndexValue (anyValueOneByte ));
221222 }
@@ -228,36 +229,36 @@ void getIndexValuesTwoByte()
228229 assertEquals (CMapStrings .getIndexValue (minValueTwoByte ),
229230 CMapStrings .getIndexValue (minValueTwoByte ));
230231 // the given values are the same objects
231- assertTrue (CMapStrings .getIndexValue (minValueTwoByte ) == CMapStrings
232+ assertSame (CMapStrings .getIndexValue (minValueTwoByte ), CMapStrings
232233 .getIndexValue (minValueTwoByte ));
233234 // check the int value
234235 assertEquals (0 , CMapStrings .getIndexValue (minValueTwoByte ));
235236
236237 byte [] maxValueTwoByte = new byte [] { (byte ) 0xff , (byte ) 0xff };
237238 assertEquals (CMapStrings .getIndexValue (maxValueTwoByte ),
238239 CMapStrings .getIndexValue (maxValueTwoByte ));
239- assertTrue (CMapStrings .getIndexValue (maxValueTwoByte ) == CMapStrings
240+ assertSame (CMapStrings .getIndexValue (maxValueTwoByte ), CMapStrings
240241 .getIndexValue (maxValueTwoByte ));
241242 assertEquals (0xffff , CMapStrings .getIndexValue (maxValueTwoByte ));
242243
243244 byte [] anyValueTwoByte1 = new byte [] { 0x62 , 0x43 };
244245 assertEquals (CMapStrings .getIndexValue (anyValueTwoByte1 ),
245246 CMapStrings .getIndexValue (anyValueTwoByte1 ));
246- assertTrue (CMapStrings .getIndexValue (anyValueTwoByte1 ) == CMapStrings
247+ assertSame (CMapStrings .getIndexValue (anyValueTwoByte1 ), CMapStrings
247248 .getIndexValue (anyValueTwoByte1 ));
248249 assertEquals (0x6243 , CMapStrings .getIndexValue (anyValueTwoByte1 ));
249250
250251 byte [] anyValueTwoByte2 = new byte [] { (byte ) 0xff , 0x43 };
251252 assertEquals (CMapStrings .getIndexValue (anyValueTwoByte2 ),
252253 CMapStrings .getIndexValue (anyValueTwoByte2 ));
253- assertTrue (CMapStrings .getIndexValue (anyValueTwoByte2 ) == CMapStrings
254+ assertSame (CMapStrings .getIndexValue (anyValueTwoByte2 ), CMapStrings
254255 .getIndexValue (anyValueTwoByte2 ));
255256 assertEquals (0xff43 , CMapStrings .getIndexValue (anyValueTwoByte2 ));
256257
257258 byte [] anyValueTwoByte3 = new byte [] { 0x38 , (byte ) 0xff };
258259 assertEquals (CMapStrings .getIndexValue (anyValueTwoByte3 ),
259260 CMapStrings .getIndexValue (anyValueTwoByte3 ));
260- assertTrue (CMapStrings .getIndexValue (anyValueTwoByte3 ) == CMapStrings
261+ assertSame (CMapStrings .getIndexValue (anyValueTwoByte3 ), CMapStrings
261262 .getIndexValue (anyValueTwoByte3 ));
262263 assertEquals (0x38ff , CMapStrings .getIndexValue (anyValueTwoByte3 ));
263264 }
0 commit comments