Keyboard

↓ ↑
move between the rows you can see
→
open a feature, then step into it
←
close a feature, or step out to the one above
Enter
go to the page in focus
Tab
the same rows, plus everything else on the page
/
search the whole report
m
open or close the navigation drawer
Esc
leave the search box, or close the drawer
?
this list

Modifying a nested collection throws, whatever collection holds it

All 9 scenarios hold

A collection that a table passes to a test method is read-only. Adding to a List or a Set throws. Putting into a Map throws. Modifying any collection nested inside them throws. A row's data therefore stays as written, however the test method treats it.

Immutability reaches every level of a row's value, so a collection reached through another collection rejects modification too.

expected outcome broken scenario
ScenarioInput valueNested collection?Nested collection type?Modification throws?
A list in a list
    • a
    • b
  • a
  • b
java.util.Listjava.lang.UnsupportedOperationException
A set in a list
    • a
    • b
  • a
  • b
java.util.Setjava.lang.UnsupportedOperationException
A map in a list
  • k
    a
k
a
java.util.Mapjava.lang.UnsupportedOperationException
A list in a set
    • a
    • b
  • a
  • b
java.util.Listjava.lang.UnsupportedOperationException
A set in a set
    • a
    • b
  • a
  • b
java.util.Setjava.lang.UnsupportedOperationException
A map in a set
  • k
    a
k
a
java.util.Mapjava.lang.UnsupportedOperationException
A list in a map
outer
  • a
  • b
  • a
  • b
java.util.Listjava.lang.UnsupportedOperationException
A set in a map
outer
  • a
  • b
  • a
  • b
java.util.Setjava.lang.UnsupportedOperationException
A map in a map
outer
k
a
k
a
java.util.Mapjava.lang.UnsupportedOperationException