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

Converts an empty collection to the declared type

All 2 scenarios hold

The generic signature of a List, Set, or Map parameter decides what its elements become. The same cell text converts to a different type according to the element type the test method declares.

Every table below reads the same way. It holds one input column per collection kind, all three carrying the same values. Then it holds the element type the method received, and the elements themselves, which the input columns must convert to.

The method signature fixes an element type, and no row can vary it. Each element type therefore gets its own table.

Only a Map's value type takes part in conversion. Its keys are always the cell text, whatever key type the signature declares.

expected outcome broken scenario
ScenarioList inputSet inputMap inputElement count?
Empty[]{}[:]0
Single element
  • a
  • a
k
a
1