package Ġorg . w ats i . device . db . models Ċ Ċ import Ġorg . junit . Assert . assertEquals Ċ import Ġorg . junit . Test Ċ import Ġorg . th reet en . bp . Instant Ċ import Ġorg . w ats i . device . factories . Bill able Model Factory Ċ import Ġorg . w ats i . device . factories . Price Schedule Model Factory Ċ import Ġorg . w ats i . domain . relations . Bill able With Price Schedule Ċ Ċ class ĠBill able With Price Schedules Model Test Ġ{ ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġto Bill able With Current Price Schedule () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġold Date Ġ= ĠInstant . of Epoch Milli ( 1 5 3 3 0 9 0 7 6 7 0 0 0 ) Ġ// Ġ 2 0 1 8 / 0 8 / 0 1 ĊĠĠĠĠĠĠĠ Ġval Ġmiddle Date Ġ= ĠInstant . of Epoch Milli ( 1 5 3 4 3 0 0 3 6 7 0 0 0 ) Ġ// Ġ 2 0 1 8 / 0 8 / 1 5 ĊĠĠĠĠĠĠĠ Ġval Ġnew Date Ġ= ĠInstant . of Epoch Milli ( 1 5 3 5 7 6 9 1 6 7 0 0 0 ) Ġ// Ġ 2 0 1 8 / 0 9 / 0 1 ĊĊĠĠĠĠĠĠĠ Ġval Ġbill able Ġ= ĠBill able Model Factory . build () ĊĠĠĠĠĠĠĠ Ġval Ġprice Schedule 1 Ġ= ĠPrice Schedule Model Factory . build ( bill able Id Ġ= Ġbill able . id , Ġissued At Ġ= Ġold Date ) ĊĠĠĠĠĠĠĠ Ġval Ġprice Schedule 2 Ġ= ĠPrice Schedule Model Factory . build ( bill able Id Ġ= Ġbill able . id , Ġissued At Ġ= Ġmiddle Date , Ġprevious Price Schedule Model Id Ġ= Ġprice Schedule 1 . id ) ĊĠĠĠĠĠĠĠ Ġval Ġprice Schedule 3 Ġ= ĠPrice Schedule Model Factory . build ( bill able Id Ġ= Ġbill able . id , Ġissued At Ġ= Ġnew Date , Ġprevious Price Schedule Model Id Ġ= Ġprice Schedule 1 . id ) ĊĠĠĠĠĠĠĠ Ġval Ġbill able With Price Schedules Ġ= ĠBill able With Price Schedules Model ( bill able , ĠlistOf ( price Schedule 1 , Ġprice Schedule 2 , Ġprice Schedule 3 )) ĊĊĠĠĠĠĠĠĠ ĠassertEquals ( Bill able With Price Schedule ( bill able . to Bill able (), Ġprice Schedule 3 . to Price Schedule ()), Ġbill able With Price Schedules . to Bill able With Current Price Schedule ()) ĊĠĠĠ Ġ} Ċ } Ċ