package Ġcom . jay new st rom . json Del ight . sample . list Ċ Ċ import Ġcom . jay new st rom . json Del ight . sample . Json TestHelper Ċ import Ġorg . fest . assertions . api . Assertions . assertThat Ċ import Ġorg . junit . Test Ċ Ċ class ĠList Test Ġ{ ĊĠĠĠ Ġ@ Test Ġfun Ġtest All The Things () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġouter Ġ= ĠJson TestHelper (). deserialize File ( Outer :: class . java , Ġ" List Test . json ", Ġthis ) ĊĠĠĠĠĠĠĠ ĠassertThat ( outer . nested ). has Size ( 2 ) ĊĠĠĠĠĠĠĠ ĠassertThat ( outer . nested [ 0 ]. foo ). isEqualTo (" a ") ĊĠĠĠĠĠĠĠ ĠassertThat ( outer . nested [ 1 ]. foo ). isEqualTo (" b ") ĊĠĠĠĠĠĠĠ Ġval Ġjson Ġ= ĠJson TestHelper (). serialize ( outer , ĠO uter :: class . java ) ĊĠĠĠĠĠĠĠ ĠassertThat ( json ). isEqualTo ("{ \" nested \": [{ \" foo \":\" a \" },{ \" foo \":\" b \" }]} ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test Ġfun Ġtest ListOf Primitives () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġbasic Ġ= ĠJson TestHelper (). deserialize File ( Basic :: class . java , Ġ" Basic Test . json ", Ġthis ) ĊĠĠĠĠĠĠĠ ĠassertThat ( basic . basic ). has Size ( 3 ) ĊĠĠĠĠĠĠĠ ĠassertThat ( basic . basic [ 0 ]). isEqualTo (" a ") ĊĠĠĠĠĠĠĠ ĠassertThat ( basic . basic [ 1 ]). isEqualTo (" b ") ĊĠĠĠĠĠĠĠ ĠassertThat ( basic . basic [ 2 ]). isEqualTo (" c ") ĊĠĠĠĠĠĠĠ Ġval Ġjson Ġ= ĠJson TestHelper (). serialize ( basic , ĠBasic :: class . java ) ĊĠĠĠĠĠĠĠ ĠassertThat ( json ). isEqualTo ("{ \" basic \":[\" a \",\" b \",\" c \"] }") ĊĠĠĠ Ġ} Ċ } Ċ