@@ -177,18 +177,20 @@ public void testSubmapView_outOfBounds_add() {
177
177
putEntry (subMap , ELEMS .get (0 ));
178
178
fail ();
179
179
} catch (IllegalArgumentException expected ) {
180
- try {
181
- putEntry (subMap , ELEMS .get (3 ));
182
- fail ();
183
- } catch (IllegalArgumentException expected2 ) {
184
- try {
185
- // the first 3 elements are in the range of the sublist, but the last isn't
186
- subMap .putAll (toAdd );
187
- fail ();
188
- } catch (IllegalArgumentException expected3 ) {
189
- // expected outcome
190
- }
191
- }
180
+ // expected outcome
181
+ }
182
+ try {
183
+ putEntry (subMap , ELEMS .get (3 ));
184
+ fail ();
185
+ } catch (IllegalArgumentException expected ) {
186
+ // expected outcome
187
+ }
188
+ try {
189
+ // the first 3 elements are in the range of the sublist, but the last isn't
190
+ subMap .putAll (toAdd );
191
+ fail ();
192
+ } catch (IllegalArgumentException expected ) {
193
+ // expected outcome
192
194
}
193
195
}
194
196
@@ -326,12 +328,13 @@ public void testGetEntryByRank_outOfBounds() {
326
328
map .getEntryByRank (-1 );
327
329
fail ("Expected " + IndexOutOfBoundsException .class .getSimpleName ());
328
330
} catch (IndexOutOfBoundsException expected ) {
329
- try {
330
- map .getEntryByRank (ELEMS .size ());
331
- fail ("Expected " + IndexOutOfBoundsException .class .getSimpleName ());
332
- } catch (IndexOutOfBoundsException expected2 ) {
333
- // expected outcome
334
- }
331
+ // expected outcome
332
+ }
333
+ try {
334
+ map .getEntryByRank (ELEMS .size ());
335
+ fail ("Expected " + IndexOutOfBoundsException .class .getSimpleName ());
336
+ } catch (IndexOutOfBoundsException expected ) {
337
+ // expected outcome
335
338
}
336
339
}
337
340
@@ -413,12 +416,13 @@ public void testGetKeyByRank_outOfBounds() {
413
416
map .getKeyByRank (-1 );
414
417
fail ("Expected " + IndexOutOfBoundsException .class .getSimpleName ());
415
418
} catch (IndexOutOfBoundsException expected ) {
416
- try {
417
- map .getKeyByRank (ELEMS .size ());
418
- fail ("Expected " + IndexOutOfBoundsException .class .getSimpleName ());
419
- } catch (IndexOutOfBoundsException expected2 ) {
420
- // expected outcome
421
- }
419
+ // expected outcome
420
+ }
421
+ try {
422
+ map .getKeyByRank (ELEMS .size ());
423
+ fail ("Expected " + IndexOutOfBoundsException .class .getSimpleName ());
424
+ } catch (IndexOutOfBoundsException expected ) {
425
+ // expected outcome
422
426
}
423
427
}
424
428
@@ -518,17 +522,20 @@ public void testRemoveByRank_invalid() {
518
522
map .removeByRank (-1 );
519
523
fail ();
520
524
} catch (IndexOutOfBoundsException expected ) {
521
- try {
522
- map .removeByRank (map .size ());
523
- fail ();
524
- } catch (IndexOutOfBoundsException expected2 ) {
525
- try {
526
- emptyMap .removeByRank (0 );
527
- fail ();
528
- } catch (IndexOutOfBoundsException expected3 ) {
529
- // expected outcome
530
- }
531
- }
525
+ // expected outcome
526
+ }
527
+ try {
528
+ map .removeByRank (map .size ());
529
+ fail ();
530
+ } catch (IndexOutOfBoundsException expected ) {
531
+ // expected outcome
532
+ }
533
+ try {
534
+ emptyMap .removeByRank (0 );
535
+ fail ();
536
+ } catch (IndexOutOfBoundsException expected ) {
537
+ // expected outcome
538
+
532
539
}
533
540
}
534
541
0 commit comments