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 whole numbers beyond the long range to BigInteger

All 2 scenarios hold

Cell text converts automatically to the declared parameter type. There is no type converter to write.

Every table below reads the same way. An Input value column holds the text as written in the cell. A Parameter type column holds the type the text converts to. Expectation columns state observable properties of the object the test method receives. Each row therefore shows that the text became a valid object of that type, and not merely that it converted.

The test method signature fixes a parameter type, and no row can vary it. Each type therefore gets its own short table.

A primitive type shares its table with its wrapper. The two are one type in two forms, and a boxed value does not report its primitive type. The value column's own header names it there, in place of a column of its own.

BigInteger holds a whole number that no other type can hold. The pair below therefore sits either side of the largest value a long holds. Each row writes its number in full, and not as a count of digits. The boundary falls inside the nineteen-digit numbers, and not between two digit counts.

expected outcome broken scenario
ScenarioInput valueParameter type?BigInteger beyond long range?
The largest a long holds9223372036854775807java.math.BigIntegerfalse
One more than a long holds9223372036854775808java.math.BigIntegertrue