package Ġcom . kar umi . kotlin snapshot . core Ċ Ċ import Ġorg . bitbucket . co ww oc . diff match patch . Diff Match Patch Ċ import Ġjava . util . LinkedList Ċ Ċ internal Ġobject ĠDiff Printer Ġ{ ĊĠĠĠ Ġprivate Ġval Ġd mp Ġ= ĠDiff Match Patch () ĊĊĠĠĠ Ġprivate Ġfun Ġprint Diff ( diff : ĠDiff Match Patch . Diff ): ĠString Ġ= ĊĠĠĠĠĠĠĠ Ġwhen Ġ( diff . operation ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠDiff Match Patch . Operation . EQUAL , Ġnull Ġ-> ĠTerm . white (" Ġ${ diff . text }\ n ") ĊĠĠĠĠĠĠĠĠĠĠĠ ĠDiff Match Patch . Operation . DELETE Ġ-> ĠTerm . red ("- Ġ${ diff . text }\ n ") ĊĠĠĠĠĠĠĠĠĠĠĠ ĠDiff Match Patch . Operation . INSERT Ġ-> ĠTerm . green ("+ Ġ${ diff . text }\ n ") ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġto Readable Console Message ( ĊĠĠĠĠĠĠĠ Ġsnapshot Name : ĠString , ĊĠĠĠĠĠĠĠ Ġdiffs : ĠLinkedList < Diff Match Patch . Diff > ĊĠĠĠ Ġ): ĠString Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġsb Ġ= ĠStringBuilder ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" Received Ġvalue Ġdoes Ġnot Ġmatch Ġstored Ġsnapshot : Ġ\"$ snapshot Name \"\ n \ n " ĊĠĠĠĠĠĠĠ Ġ) ĊĊĠĠĠĠĠĠĠ Ġd mp . diff Cleanup Semantic ( dif fs ) ĊĠĠĠĠĠĠĠ Ġdiffs . forEach Ġ{ Ġdiff Ġ-> Ġsb . append ( print Diff ( diff )) Ġ} ĊĠĠĠĠĠĠĠ Ġsb . append ("\ n \ n ") ĊĠĠĠĠĠĠĠ Ġreturn Ġsb . toString () ĊĠĠĠ Ġ} Ċ } Ċ