package Ġio . go los . go los . screens . editor Ċ Ċ import Ġandroid . text . Selection Ċ import Ġjunit . framework . Assert .* Ċ import Ġorg . junit . Before Ċ import Ġorg . junit . Test Ċ import Ġorg . junit . runner . RunWith Ċ import Ġorg . ro bo lectric . Ro bo lectric TestRunner Ċ Ċ /** Ċ Ġ* ĠCreated Ġby Ġy uri Ġy ur iv l add ur ain @ gmail . com Ġon Ġ 2 6 / 1 0 / 2 0 1 7 . Ċ Ġ*/ Ċ @ RunWith ( Ro bo lectric TestRunner :: class ) Ċ class ĠText Processor Test Ġ{ ĊĠĠĠ Ġlateinit Ġvar Ġm Text Processor : ĠText Processor ĊĊĠĠĠ Ġ@ Before ĊĠĠĠ Ġfun Ġbefore () Ġ{ ĊĠĠĠĠĠĠĠ Ġm Text Processor Ġ= ĠText Processor ĊĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġprocess Input () Ġ{ ĊĠĠĠĠĠĠĠ Ġvar Ġout Ġ= Ġm Text Processor . get InitialState () ĊĠĠĠĠĠĠĠ ĠassertEquals (" initial Ġ 1 Ġedit text ", Ġ 1 , Ġout . size ) ĊĠĠĠĠĠĠĠ Ġassert ( out [ 0 ] Ġis ĠEditor Text Part ) ĊĊĠĠĠĠĠĠĠ Ġ( out [ 0 ] Ġas ĠEditor Text Part ). start Pointer Ġ= Ġ 0 ĊĠĠĠĠĠĠĠ Ġ( out [ 0 ] Ġas ĠEditor Text Part ). end Pointer Ġ= Ġ 0 ĊĊĠĠĠĠĠĠĠ Ġout Ġ= Ġm Text Processor . process Input ( out , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠEditor Input Action . Insert Action ( Editor Image Part ( image Name Ġ= Ġ" sd gd gs ", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠimageUrl Ġ= Ġ" as dg sd "))) ĊĠĠĠĠĠĠĠ ĠassertEquals (" size Ġmust Ġbe Ġ 3 Ġparts ", Ġ 3 , Ġout . size ) ĊĠĠĠĠĠĠĠ ĠassertEquals (" first Ġdeli meter Ġis Ġempty ", Ġ"", Ġ( out [ 0 ] Ġas ĠEditor Text Part ). text . toString ()) ĊĠĠĠĠĠĠĠ ĠassertEquals (" as dg sd ", Ġ( out [ 1 ] Ġas ĠEditor Image Part ). imageUrl ) ĊĠĠĠĠĠĠĠ ĠassertEquals (" first Ġdeli meter Ġis Ġempty ", Ġ"", Ġ( out [ 2 ] Ġas ĠEditor Text Part ). text . toString ()) ĊĠĠĠĠĠĠĠ ĠassertEquals (" cursor Ġmust Ġbe Ġat Ġstart Ġof Ġlast Ġdeli meter ", ĠEditor Part . CURSOR _ POINTER _ BEGIN , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ( out [ 2 ] Ġas ĠEditor Text Part ). end Pointer ) ĊĊĊĠĠĠĠĠĠĠ Ġvar Ġpart Ġ= ĠEditor Text Part ( text Ġ= Ġ" abc ". as Sp ann able (), Ġstart Pointer Ġ= Ġ 3 , Ġend Pointer Ġ= Ġ 3 ) ĊĠĠĠĠĠĠĠ Ġout Ġ= Ġm Text Processor . process Input ( ArrayList (), ĠEditor Input Action . Insert Action ( part )) ĊĠĠĠĠĠĠĠ ĠassertEquals (" initial Ġ 1 Ġedit text ", Ġ 1 , Ġout . size ) ĊĠĠĠĠĠĠĠ ĠassertEquals (" must Ġappend Ġto Ġthe Ġend ", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠEditor Text Part ( part . id , Ġ" abc ". as Sp ann able (), Ġ 3 , Ġ 3 ), Ġout [ 0 ]) ĊĊĊĠĠĠĠĠĠĠ Ġpart . end Pointer Ġ= Ġ 2 ĊĊĠĠĠĠĠĠĠ Ġout Ġ= Ġm Text Processor . process Input ( out , ĠEditor Input Action . Insert Action ( Editor Image Part ( image Name Ġ= Ġ" sd gd gs ", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠimageUrl Ġ= Ġ" as dg sd "))) ĊĠĠĠĠĠĠĠ ĠassertEquals (" initial Ġ 3 Ġparts ", Ġ 3 , Ġout . size ) ĊĠĠĠĠĠĠĠ Ġvar Ġtemp : ĠEditor Text Part Ġ= Ġout [ 0 ] Ġas ĠEditor Text Part ĊĊĠĠĠĠĠĠĠ ĠassertEquals (" must Ġbe Ġs liced Ġ 2 Ġfirst Ġletters ", Ġ" ab ". as Sp ann able (), Ġtemp . text ) ĊĠĠĠĠĠĠĠ ĠassertEquals (" no Ġfocus ", ĠEditor Part . CURSOR _ POINTER _ NOT _ SELECTED , Ġtemp . start Pointer ) ĊĠĠĠĠĠĠĠ ĠassertEquals (" no Ġfocus ", ĠEditor Part . CURSOR _ POINTER _ NOT _ SELECTED , Ġtemp . end Pointer ) ĊĊĠĠĠĠĠĠĠ ĠassertEquals (" must Ġbe Ġimage Ġin Ġthe Ġcenter ", Ġ" as dg sd ", Ġ( out [ 1 ] Ġas ĠEditor Image Part ). imageUrl ) ĊĊĠĠĠĠĠĠĠ Ġvar Ġthird Ġ= Ġout [ 2 ] Ġas ĠEditor Text Part ĊĠĠĠĠĠĠĠ ĠassertEquals (" we Ġinserted Ġimage Ġin Ġmiddle , Ġso Ġit Ġmust Ġbe Ġs liced Ġby Ġpre last Ġchar , Ġwith Ġfocus Ġom Ġstart ", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" c ". as Sp ann able (), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġthird . text ) ĊĠĠĠĠĠĠĠ ĠassertEquals ( third . end Pointer , ĠEditor Part . CURSOR _ POINTER _ BEGIN ) ĊĊĠĠĠĠĠĠĠ Ġval Ġfirst Ġ= ĠEditor Text Part ( text Ġ= Ġ" sd ". as Sp ann able ()) ĊĊĠĠĠĠĠĠĠ Ġval Ġparts Ġ= Ġarray ListOf < Editor Part >() ĊĠĠĠĠĠĠĠ Ġparts . apply Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġadd ( first ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġadd ( Editor Image Part ( image Name Ġ= Ġ" im ", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠimageUrl Ġ= Ġ" im ")) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġadd ( Editor Text Part ( text Ġ= Ġ"". as Sp ann able (), Ġstart Pointer Ġ= ĠEditor Part . CURSOR _ POINTER _ BEGIN , Ġend Pointer Ġ= ĠEditor Part . CURSOR _ POINTER _ BEGIN )) ĊĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġout Ġ= Ġm Text Processor . process Input ( parts , ĠEditor Input Action . Delete Action ( 1 )) ĊĠĠĠĠĠĠĠ ĠassertEquals (" must Ġbe Ġ 1 Ġpart ", Ġ 1 , Ġout . size ) ĊĠĠĠĠĠĠĠ ĠassertEquals (" sd ". as Sp ann able (), Ġ( out [ 0 ] Ġas ĠEditor Text Part ). text ) ĊĠĠĠĠĠĠĠ ĠassertEquals ( 2 , Ġout [ 0 ]. end Pointer ) ĊĊĠĠĠĠĠĠĠ Ġparts [ 2 ] Ġ= ĠEditor Text Part ( text Ġ= Ġ" e ". as Sp ann able (), Ġstart Pointer Ġ= ĠEditor Part . CURSOR _ POINTER _ BEGIN , Ġend Pointer Ġ= ĠEditor Part . CURSOR _ POINTER _ BEGIN ) ĊĠĠĠĠĠĠĠ Ġout Ġ= Ġm Text Processor . process Input ( parts , ĠEditor Input Action . Delete Action ( 1 )) ĊĠĠĠĠĠĠĠ ĠassertEquals (" must Ġbe Ġ 1 Ġpart ", Ġ 1 , Ġout . size ) ĊĠĠĠĠĠĠĠ ĠassertEquals (" s de ". as Sp ann able (), Ġ( out [ 0 ] Ġas ĠEditor Text Part ). text ) ĊĠĠĠĠĠĠĠ ĠassertEquals ( 3 , Ġout [ 0 ]. end Pointer ) ĊĊĊĠĠĠĠĠĠĠ Ġout Ġ= Ġm Text Processor . process Input ( out , ĠEditor Input Action . Insert Action ( Editor Text Part ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġtext Ġ= Ġ" 1 ". as Sp ann able () ĊĠĠĠĠĠĠĠ Ġ))) ĊĠĠĠĠĠĠĠ ĠassertEquals (" must Ġbe Ġ 1 Ġpart ", Ġ 1 , Ġout . size ) ĊĠĠĠĠĠĠĠ ĠassertEquals (" s de 1 ". as Sp ann able (), Ġ( out [ 0 ] Ġas ĠEditor Text Part ). text ) ĊĠĠĠĠĠĠĠ ĠassertEquals ( 4 , Ġout [ 0 ]. end Pointer ) ĊĊĊĠĠĠĠĠĠĠ Ġ( out [ 0 ] Ġas ĠEditor Text Part ). start Pointer Ġ= Ġ 3 ĊĠĠĠĠĠĠĠ Ġ( out [ 0 ] Ġas ĠEditor Text Part ). end Pointer Ġ= Ġ 3 ĊĠĠĠĠĠĠĠ Ġout Ġ= Ġm Text Processor . process Input ( out , ĠEditor Input Action . Insert Action ( Editor Text Part ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġtext Ġ= Ġ" 2 ". as Sp ann able () ĊĠĠĠĠĠĠĠ Ġ))) ĊĠĠĠĠĠĠĠ ĠassertEquals (" must Ġbe Ġ 1 Ġpart ", Ġ 1 , Ġout . size ) ĊĠĠĠĠĠĠĠ ĠassertEquals (" we Ġinserted Ġ 2 Ġbefore Ġe Ġcharacter ", Ġ" s de 2 1 ". as Sp ann able (), Ġ( out [ 0 ] Ġas ĠEditor Text Part ). text ) ĊĠĠĠĠĠĠĠ ĠassertEquals ( 4 , Ġout [ 0 ]. end Pointer ) ĊĊĠĠĠĠĠĠĠ Ġout Ġ= Ġm Text Processor . process Input ( out , ĠEditor Input Action . Insert Action ( Editor Image Part ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġimage Name Ġ= Ġ" name ", ĠimageUrl Ġ= Ġ" imageUrl "))) ĊĊĠĠĠĠĠĠĠ ĠassertEquals (" must Ġbe Ġ 3 Ġpart ", Ġ 3 , Ġout . size ) ĊĠĠĠĠĠĠĠ ĠassertFalse ( out [ 0 ]. is Focused ()) ĊĠĠĠĠĠĠĠ ĠassertFalse ( out [ 1 ]. is Focused ()) ĊĠĠĠĠĠĠĠ ĠassertTrue ( out [ 2 ]. is Focused ()) ĊĊĠĠĠĠĠĠĠ Ġ( out Ġas ĠMutable List < Editor Part >) [ 2 ] Ġ= ĠEditor Text Part ( text Ġ= Ġ" test ". as Sp ann able (), Ġstart Pointer Ġ= Ġ 4 , Ġend Pointer Ġ= Ġ 4 ) ĊĊĠĠĠĠĠĠĠ Ġout Ġ= Ġm Text Processor . process Input ( out , ĠEditor Input Action . Insert Action ( Editor Image Part ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġimage Name Ġ= Ġ" name ", ĠimageUrl Ġ= Ġ" imageUrl "))) ĊĠĠĠĠĠĠĠ ĠassertEquals (" must Ġbe Ġ 5 Ġpart ", Ġ 5 , Ġout . size ) ĊĠĠĠĠĠĠĠ ĠassertTrue (( out [ 4 ] Ġas ĠEditor Text Part ). text . toString (). isEmpty ()) ĊĊĊĠĠĠĠĠĠĠ Ġval Ġsp ann able Ġ= Ġ" 1 2 3 Ġ 1 2 3 ". as Sp ann able () ĊĠĠĠĠĠĠĠ ĠSelection . setSelection ( span nable , Ġ 0 , Ġ 3 ) ĊĠĠĠĠĠĠĠ Ġout Ġ= Ġm Text Processor . process Input ( listOf ( Editor Text Part ( text Ġ= Ġsp ann able , Ġstart Pointer Ġ= Ġ 0 , Ġend Pointer Ġ= Ġ 3 )), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠEditor Input Action . Replace Action (" 4 5 ". as Sp ann able ())) ĊĊĊĠĠĠĠĠĠĠ ĠassertEquals (" must Ġbe Ġ 1 Ġpart ", Ġ 1 , Ġout . size ) ĊĠĠĠĠĠĠĠ ĠassertEquals (" result Ġmust Ġbe Ġ 4 5 Ġ 1 2 3 ", Ġ" 4 5 Ġ 1 2 3 ", Ġ( out [ 0 ] Ġas ĠEditor Text Part ). text . toString ()) ĊĠĠĠĠĠĠĠ ĠassertEquals (" must Ġretain Ġstart Ġselection ", Ġ 0 , Ġ( out [ 0 ] Ġas ĠEditor Text Part ). start Pointer ) ĊĠĠĠĠĠĠĠ ĠassertEquals (" must Ġretain Ġend Ġselection ", Ġ 2 , Ġ( out [ 0 ] Ġas ĠEditor Text Part ). end Pointer ) ĊĊĠĠĠĠĠĠĠ Ġ/* Ġout Ġ= Ġm Text Processor . process Input ( out , ĠEdit Ġor Input Action . Insert Action ( Editor Text Part (" ll l ", Ġnull ))) ĊĠĠĠĠĠĠĠĠ ĠassertEquals (" initial Ġ 1 Ġedit text ", Ġ 1 , Ġout . size ) ĊĠĠĠĠĠĠĠĠ ĠassertEquals (" must Ġapp en Ġto Ġthe Ġend ", ĠEditor Text Part (" ab cl ll ", Ġ 6 ), Ġout [ 0 ]) ĊĊĠĠĠĠĠĠĠĠ Ġvar Ġwith One Ġ= ĠArrayList ( out ) ĊĠĠĠĠĠĠĠĠ Ġwith One [ 0 ] Ġ= ĠEditor Text Part (" ab cl ll ", Ġ 3 ) ĊĊĠĠĠĠĠĠĠĠ Ġout Ġ= Ġm Text Processor . process Input ( with One , ĠEditor Input Action . Insert Action ( Editor Text Part (" gg g ", Ġnull ))) ĊĠĠĠĠĠĠĠĠ ĠassertEquals (" initial Ġ 1 Ġedit text ", Ġ 1 , Ġout . size ) ĊĠĠĠĠĠĠĠĠ ĠassertEquals (" must Ġapp en Ġto Ġthe Ġmiddle ", ĠEditor Text Part (" abc gg g ll l ", Ġ 6 ), Ġout [ 0 ]) ĊĊĠĠĠĠĠĠĠĠ Ġwith One . clear () ĊĠĠĠĠĠĠĠĠ Ġwith One . add ( Editor Text Part (" abc gg g ll l ", Ġ 3 )) ĊĊ ĊĠĠĠĠĠĠĠĠ Ġvar Ġwith three Ġ= ĠArrayList ( out ) ĊĠĠĠĠĠĠĠĠ Ġout Ġ= Ġm Text Processor . process Input ( with three , ĠEditor Input Action . Insert Action ( Editor Image Part (" sd gd gs 1 ", Ġ" as dg sd 1 ", Ġnull ))) ĊĠĠĠĠĠĠĠĠ ĠassertEquals (" initial Ġ 5 Ġparts ", Ġ 5 , Ġout . size ) ĊĠĠĠĠĠĠĠĠ ĠassertEquals ( Editor Text Part (" abc ", Ġnull ), Ġout [ 0 ]) ĊĠĠĠĠĠĠĠĠ ĠassertEquals ( Editor Image Part (" sd gd gs ", Ġ" as dg sd ", Ġnull ), Ġout [ 1 ]) ĊĠĠĠĠĠĠĠĠ ĠassertEquals ( Editor Text Part ("", Ġnull ), Ġout [ 2 ]) ĊĠĠĠĠĠĠĠĠ ĠassertEquals ( Editor Image Part (" sd gd gs 1 ", Ġ" as dg sd 1 ", Ġnull ), Ġout [ 3 ]) ĊĠĠĠĠĠĠĠĠ ĠassertEquals ( Editor Text Part (" gg g ll l ", ĠEditor Part . CURSOR _ POINTER _ BEGIN ), Ġout [ 4 ]) ĊĊĠĠĠĠĠĠĠĠ Ġwith three Ġ= ĠArrayList ( out ) ĊĠĠĠĠĠĠĠĠ Ġwith three [ with three . last Index ] Ġ= ĠEditor Text Part (" gg g ll l ", Ġ" gg g ll l ". length ) ĊĊĠĠĠĠĠĠĠĠ Ġout Ġ= Ġm Text Processor . process Input ( with three , ĠEditor Input Action . Insert Action ( Editor Image Part (" sd gd gs 1 ", Ġ" as dg sd 2 ", Ġnull ))) ĊĠĠĠĠĠĠĠĠ ĠassertEquals (" initial Ġ 7 Ġparts ", Ġ 7 , Ġout . size ) ĊĠĠĠĠĠĠĠĠ ĠassertEquals ( Editor Text Part (" abc ", Ġnull ), Ġout [ 0 ]) ĊĠĠĠĠĠĠĠĠ ĠassertEquals ( Editor Image Part (" sd gd gs ", Ġ" as dg sd ", Ġnull ), Ġout [ 1 ]) ĊĠĠĠĠĠĠĠĠ ĠassertEquals ( Editor Text Part ("", Ġnull ), Ġout [ 2 ]) ĊĠĠĠĠĠĠĠĠ ĠassertEquals ( Editor Image Part (" sd gd gs 1 ", Ġ" as dg sd 1 ", Ġnull ), Ġout [ 3 ]) ĊĠĠĠĠĠĠĠĠ ĠassertEquals ( Editor Text Part (" gg g ll l ", Ġnull ), Ġout [ 4 ]) ĊĠĠĠĠĠĠĠĠ ĠassertEquals ( Editor Image Part (" sd gd gs 1 ", Ġ" as dg sd 2 ", Ġnull ), Ġout [ 5 ]) ĊĠĠĠĠĠĠĠĠ ĠassertEquals ( Editor Text Part ("", ĠEditor Part . CURSOR _ POINTER _ BEGIN ), Ġout [ 6 ]) ĊĊĠĠĠĠĠĠĠĠ Ġwith three Ġ= ĠArrayList ( out ) ĊĠĠĠĠĠĠĠĠ Ġwith three [ 6 ] Ġ= ĠEditor Text Part ("", Ġnull ) ĊĠĠĠĠĠĠĠĠ Ġwith three [ 2 ] Ġ= ĠEditor Text Part ("", ĠEditor Part . CURSOR _ POINTER _ BEGIN ) ĊĊ ĊĠĠĠĠĠĠĠĠ Ġout Ġ= Ġm Text Processor . process Input ( with three , ĠEditor Input Action . Insert Action ( Editor Image Part (" sd gd gs 1 ", Ġ" as dg sd 3 ", Ġnull ))) ĊĠĠĠĠĠĠĠĠ ĠassertEquals (" initial Ġ 9 Ġparts ", Ġ 9 , Ġout . size ) ĊĠĠĠĠĠĠĠĠ ĠassertEquals ( Editor Text Part (" abc ", Ġnull ), Ġout [ 0 ]) ĊĠĠĠĠĠĠĠĠ ĠassertEquals ( Editor Image Part (" sd gd gs ", Ġ" as dg sd ", Ġnull ), Ġout [ 1 ]) ĊĠĠĠĠĠĠĠĠ ĠassertEquals ( Editor Text Part ("", Ġnull ), Ġout [ 2 ]) ĊĠĠĠĠĠĠĠĠ ĠassertEquals ( Editor Image Part (" sd gd gs 1 ", Ġ" as dg sd 3 ", Ġnull ), Ġout [ 3 ]) ĊĠĠĠĠĠĠĠĠ ĠassertEquals ( Editor Text Part ("", ĠEditor Part . CURSOR _ POINTER _ BEGIN ), Ġout [ 4 ]) ĊĠĠĠĠĠĠĠĠ ĠassertEquals ( Editor Image Part (" sd gd gs 1 ", Ġ" as dg sd 1 ", Ġnull ), Ġout [ 5 ]) ĊĠĠĠĠĠĠĠĠ ĠassertEquals ( Editor Text Part (" gg g ll l ", Ġnull ), Ġout [ 6 ]) ĊĠĠĠĠĠĠĠĠ ĠassertEquals ( Editor Image Part (" sd gd gs 1 ", Ġ" as dg sd 2 ", Ġnull ), Ġout [ 7 ]) ĊĠĠĠĠĠĠĠĠ ĠassertEquals ( Editor Text Part ("", Ġnull ), Ġout [ 8 ]) ĊĊĠĠĠĠĠĠĠĠ Ġwith three Ġ= ĠArrayList ( out ) ĊĠĠĠĠĠĠĠĠ Ġwith three [ 4 ] Ġ= ĠEditor Text Part ("", Ġnull ) ĊĠĠĠĠĠĠĠĠ Ġwith three [ 0 ] Ġ= ĠEditor Text Part (" abc ", Ġ 2 ) ĊĊĠĠĠĠĠĠĠĠ Ġout Ġ= Ġm Text Processor . process Input ( with three , ĠEditor Input Action . Insert Action ( Editor Image Part (" sd gd gs 1 ", Ġ" as dg sd 4 ", Ġnull ))) ĊĠĠĠĠĠĠĠĠ ĠassertEquals (" initial Ġ 1 1 Ġparts ", Ġ 1 1 , Ġout . size ) ĊĠĠĠĠĠĠĠĠ ĠassertEquals ( Editor Text Part (" ab ", Ġnull ), Ġout [ 0 ]) ĊĠĠĠĠĠĠĠĠ ĠassertEquals ( Editor Image Part (" sd gd gs 1 ", Ġ" as dg sd 4 ", Ġnull ), Ġout [ 1 ]) ĊĠĠĠĠĠĠĠĠ ĠassertEquals ( Editor Text Part (" c ", Ġ 0 ), Ġout [ 2 ]) ĊĠĠĠĠĠĠĠĠ ĠassertEquals ( Editor Image Part (" sd gd gs ", Ġ" as dg sd ", Ġnull ), Ġout [ 3 ]) ĊĠĠĠĠĠĠĠĠ ĠassertEquals ( Editor Text Part ("", Ġnull ), Ġout [ 1 0 ]) ĊĊ ĊĠĠĠĠĠĠĠĠ Ġ// delete Ġtest ĊĠĠĠĠĠĠĠĠ Ġwith three Ġ= ĠArrayList ( out ) ĊĠĠĠĠĠĠĠĠ Ġout Ġ= Ġm Text Processor . process Input ( with three , ĠEditor Input Action . Delete Action ( null )) ĊĠĠĠĠĠĠĠĠ ĠassertEquals (" initial Ġ 1 1 Ġparts ", Ġ 1 1 , Ġout . size ) ĊĠĠĠĠĠĠĠĠ ĠassertEquals ( Editor Text Part (" ab ", Ġnull ), Ġout [ 0 ]) ĊĠĠĠĠĠĠĠĠ ĠassertEquals ( Editor Image Part (" sd gd gs 1 ", Ġ" as dg sd 4 ", Ġnull ), Ġout [ 1 ]) ĊĠĠĠĠĠĠĠĠ ĠassertEquals ( Editor Text Part (" c ", Ġ 0 ), Ġout [ 2 ]) ĊĊĠĠĠĠĠĠĠĠ Ġwith three Ġ= ĠArrayList ( out ) ĊĠĠĠĠĠĠĠĠ Ġwith three [ 2 ] Ġ= ĠEditor Text Part (" c ", Ġ 1 ) ĊĠĠĠĠĠĠĠĠ Ġout Ġ= Ġm Text Processor . process Input ( with three , ĠEditor Input Action . Delete Action ( null )) ĊĠĠĠĠĠĠĠĠ ĠassertEquals (" must e Ġbe Ġ 1 1 Ġparts ", Ġ 1 1 , Ġout . size ) ĊĠĠĠĠĠĠĠĠ ĠassertEquals ( Editor Text Part (" ab ", Ġnull ), Ġout [ 0 ]) ĊĠĠĠĠĠĠĠĠ ĠassertEquals ( Editor Image Part (" sd gd gs 1 ", Ġ" as dg sd 4 ", Ġnull ), Ġout [ 1 ]) ĊĠĠĠĠĠĠĠĠ ĠassertEquals ( Editor Text Part ("", Ġ 0 ), Ġout [ 2 ]) ĊĊĠĠĠĠĠĠĠĠ Ġwith three Ġ= ĠArrayList ( out ) ĊĠĠĠĠĠĠĠĠ Ġout Ġ= Ġm Text Processor . process Input ( with three , ĠEditor Input Action . Delete Action ( 1 )) ĊĠĠĠĠĠĠĠĠ ĠassertEquals (" must e Ġbe Ġ 9 Ġparts ", Ġ 9 , Ġout . size ) ĊĠĠĠĠĠĠĠĠ ĠassertEquals ( Editor Text Part (" ab ", Ġ 2 ), Ġout [ 0 ]) ĊĠĠĠĠĠĠĠĠ ĠassertEquals ( Editor Image Part (" sd gd gs ", Ġ" as dg sd ", Ġnull ), Ġout [ 1 ]) */ ĊĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġprepare For Test With Multiple Parts (): ĠArrayList < Editor Part > Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġarray ListOf () ĊĠĠĠĠĠĠĠ Ġ/* ĠĠ Ġvar Ġout Ġ= ĠArrayList < Editor Part >() ĊĠĠĠĠĠĠĠĠĠĠ Ġout . add ( Editor Text Part ( text Ġ= Ġ" abc gg g ll l ", Ġpointer Position Ġ= Ġnull )) ĊĠĠĠĠĠĠĠĠĠĠ Ġout . add ( Editor Image Part ( Ġimage Name Ġ= Ġ" sd gd gs ", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠimageUrl Ġ= Ġ" as dg sd ", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġpointer Position Ġ= Ġnull )) ĊĠĠĠĠĠĠĠĠĠĠ Ġout . add ( Editor Text Part ( text Ġ= Ġ"", Ġpointer Position Ġ= Ġnull )) ĊĠĠĠĠĠĠĠĠĠĠ Ġreturn Ġout */ ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun ĠtestGet Sp ann able () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġtest Ġ= Ġ" qq ". as Sp ann able () ĊĠĠĠĠĠĠĠ Ġtest . forEach Indexed ({ Ġindex , Ġchar Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprintln (" index Ġ= Ġ$ index Ġchar Ġ= Ġ$ char ") ĊĠĠĠĠĠĠĠ Ġ}) ĊĠĠĠ Ġ} Ċ }