package Ġorg . opp ia . android . domain . hint sand solution Ċ Ċ import Ġandroid . app . Application Ċ import Ġandroid . content . Context Ċ import Ġandroidx . test . core . app . Application Provider Ċ import Ġandroidx . test . ext . junit . runners . Android JUnit 4 Ċ import Ġcom . google . common . truth . Truth . assertThat Ċ import Ġcom . google . common . truth . extensions . proto . Lite Proto Truth . assertThat Ċ import Ġdagger . Bind s Instance Ċ import Ġdagger . Component Ċ import Ġdagger . Module Ċ import Ġdagger . Provides Ċ import Ġorg . junit . Before Ċ import Ġorg . junit . Rule Ċ import Ġorg . junit . Test Ċ import Ġorg . junit . runner . RunWith Ċ import Ġorg . mockito . Mock Ċ import Ġorg . mockito . Mockito . reset Ċ import Ġorg . mockito . Mockito . verify Ċ import Ġorg . mockito . Mockito . verify No More Interactions Ċ import Ġorg . mockito . junit . Mockito JUnit Ċ import Ġorg . mockito . junit . Mockito Rule Ċ import Ġorg . opp ia . android . app . model . Ex ploration Ċ import Ġorg . opp ia . android . app . model . Help Index Ċ import Ġorg . opp ia . android . app . model . State Ċ import Ġorg . opp ia . android . domain . ex ploration . Ex ploration Retriever Ċ import Ġorg . opp ia . android . testing . Test Log Reporting Module Ċ import Ġorg . opp ia . android . testing . assert Throws Ċ import Ġorg . opp ia . android . testing . environment . Test Environment Config Ċ import Ġorg . opp ia . android . testing . ro bo lectric . Ro bo lectric Module Ċ import Ġorg . opp ia . android . testing . threading . Test Coroutine Dispatch ers Ċ import Ġorg . opp ia . android . testing . threading . Test Dispatcher Module Ċ import Ġorg . opp ia . android . util . caching . Load Lesson Protos From Assets Ċ import Ġorg . opp ia . android . util . data . Data Providers Injector Ċ import Ġorg . opp ia . android . util . data . Data Providers Injector Provider Ċ import Ġorg . opp ia . android . util . logging . Logger Module Ċ import Ġorg . ro bo lectric . annotation . Config Ċ import Ġorg . ro bo lectric . annotation . Looper Mode Ċ import Ġjava . util . concurrent . TimeUnit Ċ import Ġjavax . inject . Inject Ċ import Ġjavax . inject . Singleton Ċ Ċ /** ĠTests Ġfor Ġ[ Hint Handler Prod Impl ]. Ġ*/ Ċ @ Suppress (" FunctionName ") Ċ @ RunWith ( Android JUnit 4 :: class ) Ċ @ Looper Mode ( Looper Mode . Mode . PA USED ) Ċ @ Config ( application Ġ= ĠHint Handler Prod Impl Test . Test Application :: class ) Ċ class ĠHint Handler Prod Impl Test Ġ{ ĊĠ Ġ@ Rule ĊĠ Ġ@ Jvm Field ĊĠ Ġval Ġmock ito Rule : ĠMockito Rule Ġ= ĠMockito JUnit . rule () ĊĊĠ Ġ@ Mock ĊĠ Ġlateinit Ġvar Ġmock Hint Monitor : ĠHint Handler . Hint Monitor ĊĊĠ Ġ@ Inject ĊĠ Ġlateinit Ġvar Ġhint Handler Prod Impl Factory : ĠHint Handler Prod Impl . Factory Prod Impl ĊĊĠ Ġ@ Inject ĊĠ Ġlateinit Ġvar Ġexploration Retriever : ĠEx ploration Retriever ĊĊĠ Ġ@ Inject ĊĠ Ġlateinit Ġvar Ġtest Coroutine Dispatch ers : ĠTest Coroutine Dispatch ers ĊĊĠ Ġprivate Ġlateinit Ġvar Ġhint Handler : ĠHint Handler ĊĠ Ġprivate Ġval Ġexp With No Hints Or Solution Ġby Ġlazy Ġ{ ĊĠĠĠ Ġexploration Retriever . load Ex ploration (" test _ single _ interactive _ state _ exp _ no _ hints _ no _ solution ") ĊĠ Ġ} ĊĠ Ġprivate Ġval Ġexp With One Hint And No Solution Ġby Ġlazy Ġ{ ĊĠĠĠ Ġexploration Retriever . load Ex ploration ( ĊĠĠĠĠĠ Ġ" test _ single _ interactive _ state _ exp _ with _ one _ hint _ and _ no _ solution " ĊĠĠĠ Ġ) ĊĠ Ġ} ĊĠ Ġprivate Ġval Ġexp With One Hint And Solution Ġby Ġlazy Ġ{ ĊĠĠĠ Ġexploration Retriever . load Ex ploration ( ĊĠĠĠĠĠ Ġ" test _ single _ interactive _ state _ exp _ with _ one _ hint _ and _ solution " ĊĠĠĠ Ġ) ĊĠ Ġ} ĊĠ Ġprivate Ġval Ġexp With No Hints And One Solution Ġby Ġlazy Ġ{ ĊĠĠĠ Ġexploration Retriever . load Ex ploration (" test _ single _ interactive _ state _ exp _ with _ only _ solution ") ĊĠ Ġ} ĊĠ Ġprivate Ġval Ġexp With Hints And Solution Ġby Ġlazy Ġ{ ĊĠĠĠ Ġexploration Retriever . load Ex ploration ( ĊĠĠĠĠĠ Ġ" test _ single _ interactive _ state _ exp _ with _ hints _ and _ solution " ĊĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Before ĊĠ Ġfun ĠsetUp () Ġ{ ĊĠĠĠ ĠsetUp Test Application Component () ĊĠĠĠ Ġ// ĠUse Ġthe Ġdirect ĠHint Handler Ġfactory Ġto Ġavoid Ġtesting Ġthe Ġmodule Ġsetup . ĊĠĠĠ Ġhint Handler Ġ= Ġhint Handler Prod Impl Factory . create ( mock Hint Monitor ) ĊĠ Ġ} ĊĊĠ Ġ/* ĠTests Ġfor Ġstart Watch ing For Hints In New State Ġ*/ ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Start Watch ing For Hints _ state Without Hints _ calls Monitor () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With No Hints Or Solution . get InitialState () ĊĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĊĠĠĠ Ġverify ( mock Hint Monitor ). on Help Index Changed () ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Start Watch ing For Hints _ state Without Hints _ help Index IsEmpty () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With No Hints Or Solution . get InitialState () ĊĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĊĠĠĠ ĠassertThat ( hint Handler . getCurrent Help Index ()). isEqualTo Default Instance () ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Start Watch ing For Hints _ state Without Hints _ wait 6 0 Seconds _ monitor Not Called Again () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With No Hints Or Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġreset ( mock Hint Monitor ) ĊĊĠĠĠ ĠwaitFor 6 0 Seconds () ĊĊĠĠĠ Ġverify No More Interactions ( mock Hint Monitor ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Start Watch ing For Hints _ state Without Hints _ wait 6 0 Seconds _ help Index IsEmpty () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With No Hints Or Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĊĠĠĠ ĠwaitFor 6 0 Seconds () ĊĊĠĠĠ ĠassertThat ( hint Handler . getCurrent Help Index ()). isEqualTo Default Instance () ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Start Watch ing For Hints _ state With Hints _ calls Monitor () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĊĠĠĠ Ġverify ( mock Hint Monitor ). on Help Index Changed () ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Start Watch ing For Hints _ state With Hints _ help Index IsEmpty () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĊĠĠĠ ĠassertThat ( hint Handler . getCurrent Help Index ()). isEqualTo Default Instance () ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Start Watch ing For Hints _ state With Hints _ wait 1 0 Seconds _ does Not Call Monitor Again () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġreset ( mock Hint Monitor ) ĊĊĠĠĠ ĠwaitFor 1 0 Seconds () ĊĊĠĠĠ Ġverify No More Interactions ( mock Hint Monitor ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Start Watch ing For Hints _ state With Hints _ wait 3 0 Seconds _ does Not Call Monitor Again () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġreset ( mock Hint Monitor ) ĊĊĠĠĠ ĠwaitFor 3 0 Seconds () ĊĊĠĠĠ Ġverify No More Interactions ( mock Hint Monitor ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Start Watch ing For Hints _ state With Hints _ wait 6 0 Seconds _ calls Monitor Again () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġreset ( mock Hint Monitor ) ĊĊĠĠĠ ĠwaitFor 6 0 Seconds () ĊĊĠĠĠ Ġ// ĠVerify Ġthat Ġthe Ġmonitor Ġis Ġcalled Ġagain Ġ( since Ġthere 's Ġa Ġhint Ġnow Ġavailable ). ĊĠĠĠ Ġverify ( mock Hint Monitor ). on Help Index Changed () ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Start Watch ing For Hints _ state With Hints _ wait 6 0 Seconds _ first Hint Is Available () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĊĠĠĠ ĠwaitFor 6 0 Seconds () ĊĊĠĠĠ ĠassertThat ( hint Handler . getCurrent Help Index ()). isEqualTo ( ĊĠĠĠĠĠ ĠHelp Index . newBuilder (). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġnext Available Hint Index Ġ= Ġ 0 ĊĠĠĠĠĠ Ġ}. build () ĊĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ/* ĠTests Ġfor Ġresume Hints For Saved State Ġ*/ ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Resume Hint _ state Without Hints _ no Tracked Answers _ no Hint Visible _ calls Monitor () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With No Hints Or Solution . get InitialState () ĊĠĠĠ Ġhint Handler . resume Hints For Saved State ( ĊĠĠĠĠĠ Ġtracked Wrong Answer Count Ġ= Ġ 0 , ĊĠĠĠĠĠ ĠHelp Index . getDefaultInstance (), ĊĠĠĠĠĠ Ġstate ĊĠĠĠ Ġ) ĊĊĠĠĠ Ġverify ( mock Hint Monitor ). on Help Index Changed () ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Resume Hint _ state Without Hints _ no Tracked Answer _ no Hint Visible _ help Index IsEmpty () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With No Hints Or Solution . get InitialState () ĊĠĠĠ Ġhint Handler . resume Hints For Saved State ( ĊĠĠĠĠĠ Ġtracked Wrong Answer Count Ġ= Ġ 0 , ĊĠĠĠĠĠ ĠHelp Index . getDefaultInstance (), ĊĠĠĠĠĠ Ġstate ĊĠĠĠ Ġ) ĊĊĠĠĠ ĠassertThat ( hint Handler . getCurrent Help Index ()). isEqualTo Default Instance () ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Resume Hint _ state Without Hint _ two Tracked Answer _ no Hint Visible _ help Index IsEmpty () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With No Hints Or Solution . get InitialState () ĊĠĠĠ Ġhint Handler . resume Hints For Saved State ( ĊĠĠĠĠĠ Ġtracked Wrong Answer Count Ġ= Ġ 2 , ĊĠĠĠĠĠ ĠHelp Index . getDefaultInstance (), ĊĠĠĠĠĠ Ġstate ĊĠĠĠ Ġ) ĊĊĠĠĠ ĠassertThat ( hint Handler . getCurrent Help Index ()). isEqualTo Default Instance () ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Resume Hint _ state Without Hints _ no Tracked Answers _ wait 6 0 Seconds _ monitor Not Called Again () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With No Hints Or Solution . get InitialState () ĊĠĠĠ Ġhint Handler . resume Hints For Saved State ( ĊĠĠĠĠĠ Ġtracked Wrong Answer Count Ġ= Ġ 0 , ĊĠĠĠĠĠ ĠHelp Index . getDefaultInstance (), ĊĠĠĠĠĠ Ġstate ĊĠĠĠ Ġ) ĊĠĠĠ Ġreset ( mock Hint Monitor ) ĊĊĠĠĠ ĠwaitFor 6 0 Seconds () ĊĊĠĠĠ Ġverify No More Interactions ( mock Hint Monitor ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Resume Hint _ state Without Hints _ two Tracked An s _ no Hint Visible _ wait 6 0 Sec _ help Index IsEmpty () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With No Hints Or Solution . get InitialState () ĊĠĠĠ Ġhint Handler . resume Hints For Saved State ( ĊĠĠĠĠĠ Ġtracked Wrong Answer Count Ġ= Ġ 2 , ĊĠĠĠĠĠ ĠHelp Index . getDefaultInstance (), ĊĠĠĠĠĠ Ġstate ĊĠĠĠ Ġ) ĊĊĠĠĠ ĠwaitFor 6 0 Seconds () ĊĊĠĠĠ ĠassertThat ( hint Handler . getCurrent Help Index ()). isEqualTo Default Instance () ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Resume Hint _ state With Hints _ no Tracked Answers _ no Hint Visible _ calls Monitor () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . resume Hints For Saved State ( ĊĠĠĠĠĠ Ġtracked Wrong Answer Count Ġ= Ġ 0 , ĊĠĠĠĠĠ Ġhelp Index Ġ= ĠHelp Index . getDefaultInstance (), ĊĠĠĠĠĠ Ġstate Ġ= Ġstate ĊĠĠĠ Ġ) ĊĊĠĠĠ Ġverify ( mock Hint Monitor ). on Help Index Changed () ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Resume Hints _ state With Hints _ no Tracked Answers _ no Hint Visible _ help Index IsEmpty () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . resume Hints For Saved State ( ĊĠĠĠĠĠ Ġtracked Wrong Answer Count Ġ= Ġ 0 , ĊĠĠĠĠĠ ĠHelp Index . getDefaultInstance (), ĊĠĠĠĠĠ Ġstate ĊĠĠĠ Ġ) ĊĊĠĠĠ ĠassertThat ( hint Handler . getCurrent Help Index ()). isEqualTo Default Instance () ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Resume Hints _ state With Hints _ no Hint Visible _ wait 1 0 Seconds _ does Not Call Monitor Again () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . resume Hints For Saved State ( ĊĠĠĠĠĠ Ġtracked Wrong Answer Count Ġ= Ġ 0 , ĊĠĠĠĠĠ ĠHelp Index . getDefaultInstance (), ĊĠĠĠĠĠ Ġstate ĊĠĠĠ Ġ) ĊĠĠĠ Ġreset ( mock Hint Monitor ) ĊĊĠĠĠ ĠwaitFor 1 0 Seconds () ĊĊĠĠĠ Ġverify No More Interactions ( mock Hint Monitor ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Resume Hints _ state With Hints _ no Hint Visible _ wait 3 0 Seconds _ does Not Call Monitor Again () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . resume Hints For Saved State ( ĊĠĠĠĠĠ Ġtracked Wrong Answer Count Ġ= Ġ 0 , ĊĠĠĠĠĠ ĠHelp Index . getDefaultInstance (), ĊĠĠĠĠĠ Ġstate ĊĠĠĠ Ġ) ĊĠĠĠ Ġreset ( mock Hint Monitor ) ĊĊĠĠĠ ĠwaitFor 3 0 Seconds () ĊĊĠĠĠ Ġverify No More Interactions ( mock Hint Monitor ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Resume Hints _ state With Hints _ no Hint Visible _ wait 6 0 Seconds _ calls Monitor Again () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . resume Hints For Saved State ( ĊĠĠĠĠĠ Ġtracked Wrong Answer Count Ġ= Ġ 0 , ĊĠĠĠĠĠ ĠHelp Index . getDefaultInstance (), ĊĠĠĠĠĠ Ġstate ĊĠĠĠ Ġ) ĊĠĠĠ Ġreset ( mock Hint Monitor ) ĊĊĠĠĠ ĠwaitFor 6 0 Seconds () ĊĊĠĠĠ Ġ// ĠVerify Ġthat Ġthe Ġmonitor Ġis Ġcalled Ġagain Ġ( since Ġthere 's Ġa Ġhint Ġnow Ġavailable ). ĊĠĠĠ Ġverify ( mock Hint Monitor ). on Help Index Changed () ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Resume Hints _ state With Hints _ no Hint Visible _ wait 6 0 Seconds _ help Index Has New Available Hint () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . resume Hints For Saved State ( ĊĠĠĠĠĠ Ġtracked Wrong Answer Count Ġ= Ġ 0 , ĊĠĠĠĠĠ ĠHelp Index . getDefaultInstance (), ĊĠĠĠĠĠ Ġstate ĊĠĠĠ Ġ) ĊĠĠĠ Ġreset ( mock Hint Monitor ) ĊĊĠĠĠ ĠwaitFor 6 0 Seconds () ĊĊĠĠĠ ĠassertThat ( hint Handler . getCurrent Help Index ()). isEqualTo ( ĊĠĠĠĠĠ ĠHelp Index . newBuilder (). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġnext Available Hint Index Ġ= Ġ 0 ĊĠĠĠĠĠ Ġ}. build () ĊĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Resume Hints _ state With Hints _ hint Visible _ wait 1 0 Seconds _ does Not Call Monitor Again () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . resume Hints For Saved State ( ĊĠĠĠĠĠ Ġtracked Wrong Answer Count Ġ= Ġ 0 , ĊĠĠĠĠĠ Ġhelp Index Ġ= ĠHelp Index . newBuilder (). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġnext Available Hint Index Ġ= Ġ 0 ĊĠĠĠĠĠ Ġ}. build (), ĊĠĠĠĠĠ Ġstate ĊĠĠĠ Ġ) ĊĠĠĠ Ġreset ( mock Hint Monitor ) ĊĊĠĠĠ ĠwaitFor 1 0 Seconds () ĊĊĠĠĠ Ġverify No More Interactions ( mock Hint Monitor ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Resume Hints _ state With Hints _ hint Visible _ wait 3 0 Seconds _ does Not Call Monitor Again () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . resume Hints For Saved State ( ĊĠĠĠĠĠ Ġtracked Wrong Answer Count Ġ= Ġ 0 , ĊĠĠĠĠĠ Ġhelp Index Ġ= ĠHelp Index . newBuilder (). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġnext Available Hint Index Ġ= Ġ 0 ĊĠĠĠĠĠ Ġ}. build (), ĊĠĠĠĠĠ Ġstate ĊĠĠĠ Ġ) ĊĠĠĠ Ġreset ( mock Hint Monitor ) ĊĊĠĠĠ ĠwaitFor 3 0 Seconds () ĊĊĠĠĠ Ġverify No More Interactions ( mock Hint Monitor ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Resume Hints _ state With Hints _ hint Visible _ wait 6 0 Seconds _ does Not Call Monitor Again () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . resume Hints For Saved State ( ĊĠĠĠĠĠ Ġtracked Wrong Answer Count Ġ= Ġ 0 , ĊĠĠĠĠĠ Ġhelp Index Ġ= ĠHelp Index . newBuilder (). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġnext Available Hint Index Ġ= Ġ 0 ĊĠĠĠĠĠ Ġ}. build (), ĊĠĠĠĠĠ Ġstate ĊĠĠĠ Ġ) ĊĠĠĠ Ġreset ( mock Hint Monitor ) ĊĊĠĠĠ ĠwaitFor 6 0 Seconds () ĊĊĠĠĠ Ġverify No More Interactions ( mock Hint Monitor ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Resume Hints _ state With Hints _ hint Re ve aled _ wait 1 0 Seconds _ does Not Call Monitor Again () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . resume Hints For Saved State ( ĊĠĠĠĠĠ Ġtracked Wrong Answer Count Ġ= Ġ 0 , ĊĠĠĠĠĠ Ġhelp Index Ġ= ĠHelp Index . newBuilder (). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġlatest Re ve aled Hint Index Ġ= Ġ 0 ĊĠĠĠĠĠ Ġ}. build (), ĊĠĠĠĠĠ Ġstate ĊĠĠĠ Ġ) ĊĠĠĠ Ġreset ( mock Hint Monitor ) ĊĊĠĠĠ ĠwaitFor 1 0 Seconds () ĊĊĠĠĠ Ġverify No More Interactions ( mock Hint Monitor ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Resume Hints _ state With One Hint _ hint Re ve aled _ wait 3 0 Seconds _ calls Monitor Again () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . resume Hints For Saved State ( ĊĠĠĠĠĠ Ġtracked Wrong Answer Count Ġ= Ġ 0 , ĊĠĠĠĠĠ Ġhelp Index Ġ= ĠHelp Index . newBuilder (). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġlatest Re ve aled Hint Index Ġ= Ġ 0 ĊĠĠĠĠĠ Ġ}. build (), ĊĠĠĠĠĠ Ġstate ĊĠĠĠ Ġ) ĊĠĠĠ Ġreset ( mock Hint Monitor ) ĊĊĠĠĠ ĠwaitFor 3 0 Seconds () ĊĊĠĠĠ Ġ// ĠVerify Ġthat Ġthe Ġmonitor Ġis Ġcalled Ġagain Ġ( since Ġthere 's Ġa Ġsolution Ġnow Ġavailable ). ĊĠĠĠ Ġverify ( mock Hint Monitor ). on Help Index Changed () ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Resume Hints _ state With One Hint _ hint Re ve aled _ wait 3 0 Seconds _ help Index Has Solution () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With One Hint And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . resume Hints For Saved State ( ĊĠĠĠĠĠ Ġtracked Wrong Answer Count Ġ= Ġ 0 , ĊĠĠĠĠĠ Ġhelp Index Ġ= ĠHelp Index . newBuilder (). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġlatest Re ve aled Hint Index Ġ= Ġ 0 ĊĠĠĠĠĠ Ġ}. build (), ĊĠĠĠĠĠ Ġstate ĊĠĠĠ Ġ) ĊĠĠĠ Ġreset ( mock Hint Monitor ) ĊĊĠĠĠ ĠwaitFor 3 0 Seconds () ĊĊĠĠĠ ĠassertThat ( hint Handler . getCurrent Help Index ()). isEqualTo ( ĊĠĠĠĠĠ ĠHelp Index . newBuilder (). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġshow Solution Ġ= Ġtrue ĊĠĠĠĠĠ Ġ}. build () ĊĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Resume Hints _ state With Two Hints _ second Hint Re ve aled _ wait 3 0 Seconds _ calls Monitor Again () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . resume Hints For Saved State ( ĊĠĠĠĠĠ Ġtracked Wrong Answer Count Ġ= Ġ 0 , ĊĠĠĠĠĠ Ġhelp Index Ġ= ĠHelp Index . newBuilder (). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġlatest Re ve aled Hint Index Ġ= Ġ 1 ĊĠĠĠĠĠ Ġ}. build (), ĊĠĠĠĠĠ Ġstate ĊĠĠĠ Ġ) ĊĠĠĠ Ġreset ( mock Hint Monitor ) ĊĊĠĠĠ ĠwaitFor 3 0 Seconds () ĊĊĠĠĠ Ġ// ĠVerify Ġthat Ġthe Ġmonitor Ġis Ġcalled Ġagain Ġ( since Ġthere 's Ġa Ġsolution Ġnow Ġavailable ). ĊĠĠĠ Ġverify ( mock Hint Monitor ). on Help Index Changed () ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Resume Hints _ state With Two Hints _ second Hint Re ve aled _ wait 3 0 Seconds _ help Index Has Solution () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . resume Hints For Saved State ( ĊĠĠĠĠĠ Ġtracked Wrong Answer Count Ġ= Ġ 0 , ĊĠĠĠĠĠ Ġhelp Index Ġ= ĠHelp Index . newBuilder (). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġlatest Re ve aled Hint Index Ġ= Ġ 1 ĊĠĠĠĠĠ Ġ}. build (), ĊĠĠĠĠĠ Ġstate ĊĠĠĠ Ġ) ĊĠĠĠ Ġreset ( mock Hint Monitor ) ĊĊĠĠĠ ĠwaitFor 3 0 Seconds () ĊĊĠĠĠ ĠassertThat ( hint Handler . getCurrent Help Index ()). isEqualTo ( ĊĠĠĠĠĠ ĠHelp Index . newBuilder (). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġshow Solution Ġ= Ġtrue ĊĠĠĠĠĠ Ġ}. build () ĊĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Resume Hint _ state With Hints _ solution Visible _ calls Monitor () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . resume Hints For Saved State ( ĊĠĠĠĠĠ Ġtracked Wrong Answer Count Ġ= Ġ 0 , ĊĠĠĠĠĠ Ġhelp Index Ġ= ĠHelp Index . newBuilder (). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġshow Solution Ġ= Ġtrue ĊĠĠĠĠĠ Ġ}. build (), ĊĠĠĠĠĠ Ġstate ĊĠĠĠ Ġ) ĊĊĠĠĠ Ġverify ( mock Hint Monitor ). on Help Index Changed () ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Resume Hint _ state With Hints _ solution Visible _ help Index Has Solution () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . resume Hints For Saved State ( ĊĠĠĠĠĠ Ġtracked Wrong Answer Count Ġ= Ġ 0 , ĊĠĠĠĠĠ Ġhelp Index Ġ= ĠHelp Index . newBuilder (). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġshow Solution Ġ= Ġtrue ĊĠĠĠĠĠ Ġ}. build (), ĊĠĠĠĠĠ Ġstate ĊĠĠĠ Ġ) ĊĊĠĠĠ ĠassertThat ( hint Handler . getCurrent Help Index ()). isEqualTo ( ĊĠĠĠĠĠ ĠHelp Index . newBuilder (). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġshow Solution Ġ= Ġtrue ĊĠĠĠĠĠ Ġ}. build () ĊĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Resume Hints _ state With Hints _ solution Visible _ wait 1 0 Seconds _ does Not Call Monitor Again () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . resume Hints For Saved State ( ĊĠĠĠĠĠ Ġtracked Wrong Answer Count Ġ= Ġ 0 , ĊĠĠĠĠĠ Ġhelp Index Ġ= ĠHelp Index . newBuilder (). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġshow Solution Ġ= Ġtrue ĊĠĠĠĠĠ Ġ}. build (), ĊĠĠĠĠĠ Ġstate ĊĠĠĠ Ġ) ĊĠĠĠ Ġreset ( mock Hint Monitor ) ĊĊĠĠĠ ĠwaitFor 1 0 Seconds () ĊĊĠĠĠ Ġverify No More Interactions ( mock Hint Monitor ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Resume Hints _ state With Hints _ solution Visible _ wait 3 0 Seconds _ does Not Call Monitor Again () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . resume Hints For Saved State ( ĊĠĠĠĠĠ Ġtracked Wrong Answer Count Ġ= Ġ 0 , ĊĠĠĠĠĠ Ġhelp Index Ġ= ĠHelp Index . newBuilder (). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġshow Solution Ġ= Ġtrue ĊĠĠĠĠĠ Ġ}. build (), ĊĠĠĠĠĠ Ġstate ĊĠĠĠ Ġ) ĊĠĠĠ Ġreset ( mock Hint Monitor ) ĊĊĠĠĠ ĠwaitFor 3 0 Seconds () ĊĊĠĠĠ Ġverify No More Interactions ( mock Hint Monitor ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Resume Hints _ state With Hints _ solution Visible _ wait 6 0 Seconds _ does Not Call Monitor Again () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . resume Hints For Saved State ( ĊĠĠĠĠĠ Ġtracked Wrong Answer Count Ġ= Ġ 0 , ĊĠĠĠĠĠ Ġhelp Index Ġ= ĠHelp Index . newBuilder (). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġshow Solution Ġ= Ġtrue ĊĠĠĠĠĠ Ġ}. build (), ĊĠĠĠĠĠ Ġstate ĊĠĠĠ Ġ) ĊĠĠĠ Ġreset ( mock Hint Monitor ) ĊĊĠĠĠ ĠwaitFor 6 0 Seconds () ĊĊĠĠĠ Ġverify No More Interactions ( mock Hint Monitor ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Resume Hint _ state With Hints _ everything Visible _ calls Monitor () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . resume Hints For Saved State ( ĊĠĠĠĠĠ Ġtracked Wrong Answer Count Ġ= Ġ 0 , ĊĠĠĠĠĠ Ġhelp Index Ġ= ĠHelp Index . newBuilder (). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġeverything Re ve aled Ġ= Ġtrue ĊĠĠĠĠĠ Ġ}. build (), ĊĠĠĠĠĠ Ġstate ĊĠĠĠ Ġ) ĊĊĠĠĠ Ġverify ( mock Hint Monitor ). on Help Index Changed () ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Resume Hint _ state With Hints _ everything Visible _ help Index Shows Everything () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . resume Hints For Saved State ( ĊĠĠĠĠĠ Ġtracked Wrong Answer Count Ġ= Ġ 0 , ĊĠĠĠĠĠ Ġhelp Index Ġ= ĠHelp Index . newBuilder (). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġeverything Re ve aled Ġ= Ġtrue ĊĠĠĠĠĠ Ġ}. build (), ĊĠĠĠĠĠ Ġstate ĊĠĠĠ Ġ) ĊĊĠĠĠ ĠassertThat ( hint Handler . getCurrent Help Index ()). isEqualTo ( ĊĠĠĠĠĠ ĠHelp Index . newBuilder (). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġeverything Re ve aled Ġ= Ġtrue ĊĠĠĠĠĠ Ġ}. build () ĊĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Resume Hints _ state With Hints _ everything Visible _ wait 1 0 Seconds _ does Not Call Monitor Again () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . resume Hints For Saved State ( ĊĠĠĠĠĠ Ġtracked Wrong Answer Count Ġ= Ġ 0 , ĊĠĠĠĠĠ Ġhelp Index Ġ= ĠHelp Index . newBuilder (). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġeverything Re ve aled Ġ= Ġtrue ĊĠĠĠĠĠ Ġ}. build (), ĊĠĠĠĠĠ Ġstate ĊĠĠĠ Ġ) ĊĠĠĠ Ġreset ( mock Hint Monitor ) ĊĊĠĠĠ ĠwaitFor 1 0 Seconds () ĊĊĠĠĠ Ġverify No More Interactions ( mock Hint Monitor ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Resume Hints _ state With Hints _ everything Visible _ wait 3 0 Seconds _ does Not Call Monitor Again () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . resume Hints For Saved State ( ĊĠĠĠĠĠ Ġtracked Wrong Answer Count Ġ= Ġ 0 , ĊĠĠĠĠĠ Ġhelp Index Ġ= ĠHelp Index . newBuilder (). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġeverything Re ve aled Ġ= Ġtrue ĊĠĠĠĠĠ Ġ}. build (), ĊĠĠĠĠĠ Ġstate ĊĠĠĠ Ġ) ĊĠĠĠ Ġreset ( mock Hint Monitor ) ĊĊĠĠĠ ĠwaitFor 1 0 Seconds () ĊĊĠĠĠ Ġverify No More Interactions ( mock Hint Monitor ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Resume Hints _ state With Hints _ everything Visible _ wait 6 0 Seconds _ does Not Call Monitor Again () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . resume Hints For Saved State ( ĊĠĠĠĠĠ Ġtracked Wrong Answer Count Ġ= Ġ 0 , ĊĠĠĠĠĠ Ġhelp Index Ġ= ĠHelp Index . newBuilder (). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġeverything Re ve aled Ġ= Ġtrue ĊĠĠĠĠĠ Ġ}. build (), ĊĠĠĠĠĠ Ġstate ĊĠĠĠ Ġ) ĊĠĠĠ Ġreset ( mock Hint Monitor ) ĊĊĠĠĠ ĠwaitFor 1 0 Seconds () ĊĊĠĠĠ Ġverify No More Interactions ( mock Hint Monitor ) ĊĠ Ġ} ĊĊĠ Ġ/* ĠTests Ġfor Ġfinish State Ġ*/ ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Finish State _ default State _ calls Monitor () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġreset ( mock Hint Monitor ) ĊĊĠĠĠ Ġ// ĠSim ulate Ġthe Ġdefault Ġinstance Ġcase Ġ( which Ġcan Ġoccur Ġspecifically Ġfor Ġquestions ). ĊĠĠĠ Ġhint Handler . finish State ( State . getDefaultInstance ()) ĊĊĠĠĠ Ġverify ( mock Hint Monitor ). on Help Index Changed () ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Finish State _ default State _ help Index IsEmpty () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĊĠĠĠ Ġ// ĠSim ulate Ġthe Ġdefault Ġinstance Ġcase Ġ( which Ġcan Ġoccur Ġspecifically Ġfor Ġquestions ). ĊĠĠĠ Ġhint Handler . finish State ( State . getDefaultInstance ()) ĊĊĠĠĠ ĠassertThat ( hint Handler . getCurrent Help Index ()). isEqualTo Default Instance () ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Finish State _ default State _ wait 6 0 Seconds _ monitor Not Called Again () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġhint Handler . finish State ( State . getDefaultInstance ()) ĊĠĠĠ Ġreset ( mock Hint Monitor ) ĊĊĠĠĠ ĠwaitFor 6 0 Seconds () ĊĊĠĠĠ Ġverify No More Interactions ( mock Hint Monitor ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Finish State _ default State _ wait 6 0 Seconds _ help Index St ays Empty () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġhint Handler . finish State ( State . getDefaultInstance ()) ĊĠĠĠ Ġreset ( mock Hint Monitor ) ĊĊĠĠĠ ĠwaitFor 6 0 Seconds () ĊĊĠĠĠ ĠassertThat ( hint Handler . getCurrent Help Index ()). isEqualTo Default Instance () ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Finish State _ newState With Hints _ help Index IsEmpty () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĊĠĠĠ Ġ// ĠNote Ġthat Ġthis Ġis Ġslightly Ġsuspect : Ġnormally , Ġa Ġstate Ġwould Ġbe Ġs ourced Ġfrom Ġan Ġindependent ĊĠĠĠ Ġ// Ġquestion Ġor Ġfrom Ġthe Ġsame Ġexploration . ĠThis Ġt actic Ġis Ġtaken Ġto Ġsimplify Ġthe Ġdata Ġstructure ĊĠĠĠ Ġ// Ġrequirements Ġfor Ġthe Ġtest , Ġand Ġbecause Ġit Ġshould Ġbe Ġmore Ġor Ġless Ġfunction ally Ġequivalent . ĊĠĠĠ Ġhint Handler . finish State ( exp With One Hint And No Solution . get InitialState ()) ĊĊĠĠĠ Ġ// ĠThe Ġhelp Ġindex Ġshould Ġbe Ġreset . ĊĠĠĠ ĠassertThat ( hint Handler . getCurrent Help Index ()). isEqualTo Default Instance () ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Finish State _ newState With Hints _ wait 6 0 Seconds _ calls Monitor Again () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġhint Handler . finish State ( exp With One Hint And No Solution . get InitialState ()) ĊĠĠĠ Ġreset ( mock Hint Monitor ) ĊĊĠĠĠ ĠwaitFor 6 0 Seconds () ĊĊĠĠĠ Ġ// ĠThe Ġindex Ġshould Ġbe Ġcalled Ġagain Ġnow Ġthat Ġthere 's Ġa Ġnew Ġindex . ĊĠĠĠ Ġverify ( mock Hint Monitor ). on Help Index Changed () ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Finish State _ previous State Fully Re ve aled _ newState With Hints _ wait 6 0 Seconds _ index Has New Hint () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġtrigger And Re veal Everything In Multi Hint State () ĊĠĠĠ Ġhint Handler . finish State ( exp With One Hint And No Solution . get InitialState ()) ĊĊĠĠĠ ĠwaitFor 6 0 Seconds () ĊĊĠĠĠ Ġ// ĠA Ġnew Ġhint Ġindex Ġshould Ġbe Ġreve aled Ġdespite Ġthe Ġentire Ġprevious Ġstate Ġbeing Ġcompleted Ġ( since ĊĠĠĠ Ġ// Ġthe Ġhandler Ġhas Ġbeen Ġreset ). ĊĠĠĠ ĠassertThat ( hint Handler . getCurrent Help Index ()). isEqualTo ( ĊĠĠĠĠĠ ĠHelp Index . newBuilder (). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġnext Available Hint Index Ġ= Ġ 0 ĊĠĠĠĠĠ Ġ}. build () ĊĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Finish State _ newState Without Hints _ wait 6 0 Seconds _ does Not Call Monitor Again () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġtrigger And Re veal Everything In Multi Hint State () ĊĠĠĠ Ġhint Handler . finish State ( exp With No Hints Or Solution . get InitialState ()) ĊĠĠĠ Ġreset ( mock Hint Monitor ) ĊĊĠĠĠ ĠwaitFor 6 0 Seconds () ĊĊĠĠĠ Ġ// ĠSince Ġthe Ġnew Ġstate Ġdoesn 't Ġhave Ġany Ġhints , Ġthe Ġindex Ġwill Ġnot Ġchange . ĊĠĠĠ Ġverify No More Interactions ( mock Hint Monitor ) ĊĠ Ġ} ĊĊĠ Ġ/* ĠTests Ġfor Ġhandle Wrong Answer Submission Ġ*/ ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Wrong Answer Submission _ state With Hints _ monitor Not Called () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġreset ( mock Hint Monitor ) ĊĊĠĠĠ Ġhint Handler . handle Wrong Answer Submission ( wrong Answer Count Ġ= Ġ 1 ) ĊĊĠĠĠ Ġverify No More Interactions ( mock Hint Monitor ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Wrong Answer Submission _ state With Hints _ help Index St ays Empty () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĊĠĠĠ Ġhint Handler . handle Wrong Answer Submission ( wrong Answer Count Ġ= Ġ 1 ) ĊĊĠĠĠ ĠassertThat ( hint Handler . getCurrent Help Index ()). isEqualTo Default Instance () ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Wrong Answer Submission _ state With Hints _ wait 1 0 seconds _ monitor Not Called () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġhint Handler . handle Wrong Answer Submission ( wrong Answer Count Ġ= Ġ 1 ) ĊĠĠĠ Ġreset ( mock Hint Monitor ) ĊĊĠĠĠ ĠwaitFor 1 0 Seconds () ĊĊĠĠĠ Ġverify No More Interactions ( mock Hint Monitor ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Wrong Answer Submission _ state With Hints _ wait 3 0 seconds _ monitor Not Called () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġhint Handler . handle Wrong Answer Submission ( wrong Answer Count Ġ= Ġ 1 ) ĊĠĠĠ Ġreset ( mock Hint Monitor ) ĊĊĠĠĠ ĠwaitFor 3 0 Seconds () ĊĊĠĠĠ Ġverify No More Interactions ( mock Hint Monitor ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Wrong Answer Submission _ state With Hints _ wait 6 0 seconds _ monitor Called () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġhint Handler . handle Wrong Answer Submission ( wrong Answer Count Ġ= Ġ 1 ) ĊĠĠĠ Ġreset ( mock Hint Monitor ) ĊĊĠĠĠ ĠwaitFor 6 0 Seconds () ĊĊĠĠĠ Ġ// ĠA Ġhint Ġshould Ġnow Ġbe Ġavailable , Ġso Ġthe Ġmonitor Ġwill Ġbe Ġnotified . ĊĠĠĠ Ġverify ( mock Hint Monitor ). on Help Index Changed () ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Wrong Answer Submission _ state With Hints _ wait 6 0 seconds _ help Index Has Available Hint () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġhint Handler . handle Wrong Answer Submission ( wrong Answer Count Ġ= Ġ 1 ) ĊĊĠĠĠ ĠwaitFor 6 0 Seconds () ĊĊĠĠĠ ĠassertThat ( hint Handler . getCurrent Help Index ()). isEqualTo ( ĊĠĠĠĠĠ ĠHelp Index . newBuilder (). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġnext Available Hint Index Ġ= Ġ 0 ĊĠĠĠĠĠ Ġ}. build () ĊĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Wrong Answer Submission _ tw ice _ state With Hints _ monitor Called () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġreset ( mock Hint Monitor ) ĊĊĠĠĠ Ġ// ĠSim ulate Ġtwo Ġanswers Ġbeing Ġsubmitted Ġsubsequent ly . ĊĠĠĠ Ġhint Handler . handle Wrong Answer Submission ( wrong Answer Count Ġ= Ġ 1 ) ĊĠĠĠ Ġhint Handler . handle Wrong Answer Submission ( wrong Answer Count Ġ= Ġ 2 ) ĊĊĠĠĠ Ġ// ĠSubmit ting Ġtwo Ġwrong Ġanswers Ġsubsequent ly Ġshould Ġimmediately Ġresult Ġin Ġa Ġhint Ġbeing Ġavailable . ĊĠĠĠ Ġverify ( mock Hint Monitor ). on Help Index Changed () ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Wrong Answer Submission _ tw ice _ state With Hints _ help Index Has Available Hint () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĊĠĠĠ Ġ// ĠSim ulate Ġtwo Ġanswers Ġbeing Ġsubmitted Ġsubsequent ly . ĊĠĠĠ Ġhint Handler . handle Wrong Answer Submission ( wrong Answer Count Ġ= Ġ 1 ) ĊĠĠĠ Ġhint Handler . handle Wrong Answer Submission ( wrong Answer Count Ġ= Ġ 2 ) ĊĊĠĠĠ ĠassertThat ( hint Handler . getCurrent Help Index ()). isEqualTo ( ĊĠĠĠĠĠ ĠHelp Index . newBuilder (). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġnext Available Hint Index Ġ= Ġ 0 ĊĠĠĠĠĠ Ġ}. build () ĊĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Wrong Answer Submission _ tw ice _ state Without Hints _ monitor Not Called () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With No Hints Or Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġreset ( mock Hint Monitor ) ĊĊĠĠĠ Ġ// ĠSim ulate Ġtwo Ġanswers Ġbeing Ġsubmitted Ġsubsequent ly . ĊĠĠĠ Ġhint Handler . handle Wrong Answer Submission ( wrong Answer Count Ġ= Ġ 1 ) ĊĠĠĠ Ġhint Handler . handle Wrong Answer Submission ( wrong Answer Count Ġ= Ġ 2 ) ĊĊĠĠĠ Ġ// ĠNo Ġnotification Ġshould Ġhappen Ġsince Ġthe Ġstate Ġdoesn 't Ġhave Ġany Ġhints . ĊĠĠĠ Ġverify No More Interactions ( mock Hint Monitor ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Wrong Answer Submission _ tw ice _ state Without Hints _ help Index IsEmpty () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With No Hints Or Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĊĠĠĠ Ġ// ĠSim ulate Ġtwo Ġanswers Ġbeing Ġsubmitted Ġsubsequent ly . ĊĠĠĠ Ġhint Handler . handle Wrong Answer Submission ( wrong Answer Count Ġ= Ġ 1 ) ĊĠĠĠ Ġhint Handler . handle Wrong Answer Submission ( wrong Answer Count Ġ= Ġ 2 ) ĊĊĠĠĠ Ġ// ĠNo Ġhint Ġis Ġavailable Ġsince Ġthe Ġstate Ġhas Ġno Ġhints . ĊĠĠĠ ĠassertThat ( hint Handler . getCurrent Help Index ()). isEqualTo Default Instance () ĊĠ Ġ} ĊĊĠ Ġ/* ĠTests Ġfor Ġview Hint Ġ*/ ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest View Hint _ no Hint Available _ throws Exception () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĊĠĠĠ Ġval Ġexception Ġ= ĠassertThrows ( IllegalStateException :: class ) Ġ{ ĊĠĠĠĠĠ Ġhint Handler . view Hint ( hint Index Ġ= Ġ 0 ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ// ĠNo Ġhint Ġis Ġavailable Ġto Ġreveal . ĊĠĠĠ ĠassertThat ( exception ). has Message That (). contains (" Cannot Ġreveal Ġhint ") ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest View Hint _ hint Available _ calls Monitor () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġtrigger First Hint () ĊĠĠĠ Ġreset ( mock Hint Monitor ) ĊĊĠĠĠ Ġhint Handler . view Hint ( hint Index Ġ= Ġ 0 ) ĊĊĠĠĠ Ġ// ĠView ing Ġthe Ġhint Ġshould Ġtrigger Ġa Ġchange Ġin Ġthe Ġhelp Ġindex . ĊĠĠĠ Ġverify ( mock Hint Monitor ). on Help Index Changed () ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest View Hint _ hint Available _ help Index Updated To Show Hint Shown () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġtrigger First Hint () ĊĠĠĠ Ġreset ( mock Hint Monitor ) ĊĊĠĠĠ Ġhint Handler . view Hint ( hint Index Ġ= Ġ 0 ) ĊĊĠĠĠ ĠassertThat ( hint Handler . getCurrent Help Index ()). isEqualTo ( ĊĠĠĠĠĠ ĠHelp Index . newBuilder (). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġlatest Re ve aled Hint Index Ġ= Ġ 0 ĊĠĠĠĠĠ Ġ}. build () ĊĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest View Hint _ hint Available _ multi Hint State _ wait 1 0 Seconds _ monitor Not Called () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġtrigger First Hint () ĊĠĠĠ Ġhint Handler . view Hint ( hint Index Ġ= Ġ 0 ) ĊĠĠĠ Ġreset ( mock Hint Monitor ) ĊĊĠĠĠ ĠwaitFor 1 0 Seconds () ĊĊĠĠĠ Ġverify No More Interactions ( mock Hint Monitor ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest View Hint _ hint Available _ multi Hint State _ wait 3 0 Seconds _ monitor Called () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġtrigger First Hint () ĊĠĠĠ Ġhint Handler . view Hint ( hint Index Ġ= Ġ 0 ) ĊĠĠĠ Ġreset ( mock Hint Monitor ) ĊĊĠĠĠ ĠwaitFor 3 0 Seconds () ĊĊĠĠĠ Ġ// Ġ 3 0 Ġseconds Ġis Ġlong Ġenough Ġto Ġtrigger Ġa Ġsecond Ġhint Ġto Ġbe Ġavailable . ĊĠĠĠ Ġverify ( mock Hint Monitor ). on Help Index Changed () ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest View Hint _ hint Available _ multi Hint State _ wait 3 0 Seconds _ help Index Has New Available Hint () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġtrigger First Hint () ĊĠĠĠ Ġhint Handler . view Hint ( hint Index Ġ= Ġ 0 ) ĊĊĠĠĠ ĠwaitFor 3 0 Seconds () ĊĊĠĠĠ ĠassertThat ( hint Handler . getCurrent Help Index ()). isEqualTo ( ĊĠĠĠĠĠ ĠHelp Index . newBuilder (). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġnext Available Hint Index Ġ= Ġ 1 ĊĠĠĠĠĠ Ġ}. build () ĊĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest View Hint _ hint Available _ multi Hint State _ all Hints Re ve aled _ index Shows Last Re ve aled Hint () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĊĠĠĠ Ġtrigger And Re veal First Hint () ĊĠĠĠ Ġtrigger And Re veal Second Hint () ĊĊĠĠĠ ĠassertThat ( hint Handler . getCurrent Help Index ()). isEqualTo ( ĊĠĠĠĠĠ ĠHelp Index . newBuilder (). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġlatest Re ve aled Hint Index Ġ= Ġ 1 ĊĠĠĠĠĠ Ġ}. build () ĊĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest View Hint _ multi Hint State _ all Hints Re ve aled _ trigger Solution _ index Shows Solution () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġtrigger And Re veal First Hint () ĊĠĠĠ Ġtrigger And Re veal Second Hint () ĊĊĠĠĠ Ġtrigger Solution () ĊĊĠĠĠ ĠassertThat ( hint Handler . getCurrent Help Index ()). isEqualTo ( ĊĠĠĠĠĠ ĠHelp Index . newBuilder (). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġshow Solution Ġ= Ġtrue ĊĠĠĠĠĠ Ġ}. build () ĊĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest View Hint _ hint Available _ one Hint State _ with Solution _ wait 1 0 Sec _ monitor Not Called () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With One Hint And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġtrigger And Re veal First Hint () ĊĠĠĠ Ġreset ( mock Hint Monitor ) ĊĊĠĠĠ ĠwaitFor 1 0 Seconds () ĊĊĠĠĠ Ġverify No More Interactions ( mock Hint Monitor ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest View Hint _ hint Available _ one Hint State _ with Solution _ wait 3 0 Sec _ monitor Called () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With One Hint And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġtrigger And Re veal First Hint () ĊĠĠĠ Ġreset ( mock Hint Monitor ) ĊĊĠĠĠ ĠwaitFor 3 0 Seconds () ĊĊĠĠĠ Ġ// ĠThe Ġsolution Ġshould Ġnow Ġbe Ġavailable . ĊĠĠĠ Ġverify ( mock Hint Monitor ). on Help Index Changed () ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest View Hint _ hint Available _ one Hint State _ with Solution _ wait 3 0 Sec _ index Shows Solution () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With One Hint And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġtrigger And Re veal First Hint () ĊĊĠĠĠ ĠwaitFor 3 0 Seconds () ĊĊĠĠĠ ĠassertThat ( hint Handler . getCurrent Help Index ()). isEqualTo ( ĊĠĠĠĠĠ ĠHelp Index . newBuilder (). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġshow Solution Ġ= Ġtrue ĊĠĠĠĠĠ Ġ}. build () ĊĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest View Hint _ hint Available _ one Hint State _ no Solution _ wait 1 0 Sec _ monitor Not Called () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With One Hint And No Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġtrigger And Re veal First Hint () ĊĠĠĠ Ġreset ( mock Hint Monitor ) ĊĊĠĠĠ ĠwaitFor 1 0 Seconds () ĊĊĠĠĠ Ġverify No More Interactions ( mock Hint Monitor ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest View Hint _ hint Available _ one Hint State _ no Solution _ wait 3 0 Sec _ monitor Not Called () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With One Hint And No Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġtrigger And Re veal First Hint () ĊĠĠĠ Ġreset ( mock Hint Monitor ) ĊĊĠĠĠ ĠwaitFor 3 0 Seconds () ĊĊĠĠĠ Ġ// ĠThe Ġindex Ġis Ġstill Ġunchanged Ġsince Ġthere 's Ġnothing Ġleft Ġto Ġsee . ĊĠĠĠ Ġverify No More Interactions ( mock Hint Monitor ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest View Hint _ latest Hint View ed _ throws Exception () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġtrigger And Re veal First Hint () ĊĊĠĠĠ Ġval Ġexception Ġ= ĠassertThrows ( IllegalStateException :: class ) Ġ{ ĊĠĠĠĠĠ Ġhint Handler . view Hint ( hint Index Ġ= Ġ 0 ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ// ĠNo Ġhint Ġis Ġavailable Ġto Ġreveal Ġsince Ġit 's Ġalready Ġbeen Ġreve aled . ĊĠĠĠ ĠassertThat ( exception ). has Message That (). contains (" Cannot Ġreveal Ġhint ") ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest View Hint _ solution Available _ throws Exception () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġtrigger And Re veal First Hint () ĊĠĠĠ Ġtrigger And Re veal Second Hint () ĊĊĠĠĠ Ġval Ġexception Ġ= ĠassertThrows ( IllegalStateException :: class ) Ġ{ ĊĠĠĠĠĠ Ġhint Handler . view Hint ( hint Index Ġ= Ġ 0 ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ// ĠNo Ġhint Ġis Ġavailable Ġto Ġreveal Ġsince Ġall Ġhints Ġhave Ġbeen Ġreve aled . ĊĠĠĠ ĠassertThat ( exception ). has Message That (). contains (" Cannot Ġreveal Ġhint ") ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest View Hint _ everything Re ve aled _ throws Exception () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġtrigger And Re veal First Hint () ĊĠĠĠ Ġtrigger And Re veal Second Hint () ĊĠĠĠ Ġtrigger And Re veal Solution () ĊĊĠĠĠ Ġval Ġexception Ġ= ĠassertThrows ( IllegalStateException :: class ) Ġ{ ĊĠĠĠĠĠ Ġhint Handler . view Hint ( hint Index Ġ= Ġ 0 ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ// ĠNo Ġhint Ġis Ġavailable Ġto Ġreveal Ġsince Ġeverything Ġhas Ġbeen Ġreve aled . ĊĠĠĠ ĠassertThat ( exception ). has Message That (). contains (" Cannot Ġreveal Ġhint ") ĊĠ Ġ} ĊĊĠ Ġ/* ĠTests Ġfor Ġview Solution Ġ*/ ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest View Solution _ nothing Available _ throws Exception () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĊĠĠĠ Ġval Ġexception Ġ= ĠassertThrows ( IllegalStateException :: class ) Ġ{ ĊĠĠĠĠĠ Ġhint Handler . view Solution () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ// ĠThe Ġsolution Ġis Ġnot Ġyet Ġavailable Ġto Ġbe Ġseen Ġ( no Ġhints Ġhave Ġbeen Ġviewed ). ĊĠĠĠ ĠassertThat ( exception ). has Message That (). contains (" Cannot Ġreveal Ġsolution ") ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest View Solution _ hint Available _ throws Exception () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġtrigger First Hint () ĊĊĠĠĠ Ġval Ġexception Ġ= ĠassertThrows ( IllegalStateException :: class ) Ġ{ ĊĠĠĠĠĠ Ġhint Handler . view Solution () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ// ĠThe Ġsolution Ġis Ġnot Ġyet Ġavailable Ġto Ġbe Ġseen Ġ( one Ġhint Ġis Ġavailable , Ġbut Ġhasn 't Ġbeen Ġviewed ). ĊĠĠĠ ĠassertThat ( exception ). has Message That (). contains (" Cannot Ġreveal Ġsolution ") ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest View Solution _ hint View ed _ throws Exception () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġtrigger And Re veal First Hint () ĊĊĠĠĠ Ġval Ġexception Ġ= ĠassertThrows ( IllegalStateException :: class ) Ġ{ ĊĠĠĠĠĠ Ġhint Handler . view Solution () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ// ĠThe Ġsolution Ġis Ġnot Ġyet Ġavailable Ġto Ġbe Ġseen Ġ( one Ġhint Ġwas Ġviewed , Ġbut Ġthe Ġsolution Ġisn 't ĊĠĠĠ Ġ// Ġavailable Ġyet ). ĊĠĠĠ ĠassertThat ( exception ). has Message That (). contains (" Cannot Ġreveal Ġsolution ") ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest View Solution _ all Hints View ed _ solution Not Triggered _ throws Exception () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġtrigger And Re veal First Hint () ĊĠĠĠ Ġtrigger And Re veal Second Hint () ĊĊĠĠĠ Ġval Ġexception Ġ= ĠassertThrows ( IllegalStateException :: class ) Ġ{ ĊĠĠĠĠĠ Ġhint Handler . view Solution () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ// ĠThe Ġsolution Ġis Ġnot Ġyet Ġavailable Ġto Ġbe Ġseen Ġsince Ġthe Ġuser Ġhasn 't Ġtriggered Ġthe Ġsolution Ġto ĊĠĠĠ Ġ// Ġactually Ġshow Ġup . ĊĠĠĠ ĠassertThat ( exception ). has Message That (). contains (" Cannot Ġreveal Ġsolution ") ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest View Solution _ solution Available _ calls Monitor () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġtrigger And Re veal First Hint () ĊĠĠĠ Ġtrigger And Re veal Second Hint () ĊĠĠĠ Ġtrigger Solution () ĊĠĠĠ Ġreset ( mock Hint Monitor ) ĊĊĠĠĠ Ġhint Handler . view Solution () ĊĊĠĠĠ Ġ// ĠThe Ġhelp Ġindex Ġshould Ġchange Ġwhen Ġthe Ġsolution Ġis Ġreve aled . ĊĠĠĠ Ġverify ( mock Hint Monitor ). on Help Index Changed () ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest View Solution _ solution Available _ help Index Updated To Show Everything () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġtrigger And Re veal First Hint () ĊĠĠĠ Ġtrigger And Re veal Second Hint () ĊĠĠĠ Ġtrigger Solution () ĊĊĠĠĠ Ġhint Handler . view Solution () ĊĊĠĠĠ ĠassertThat ( hint Handler . getCurrent Help Index ()). isEqualTo ( ĊĠĠĠĠĠ ĠHelp Index . newBuilder (). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġeverything Re ve aled Ġ= Ġtrue ĊĠĠĠĠĠ Ġ}. build () ĊĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest View Solution _ solution Available _ wait 1 0 Sec _ monitor Not Called () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġtrigger And Re veal First Hint () ĊĠĠĠ Ġtrigger And Re veal Second Hint () ĊĠĠĠ Ġtrigger Solution () ĊĠĠĠ Ġhint Handler . view Solution () ĊĠĠĠ Ġreset ( mock Hint Monitor ) ĊĊĠĠĠ ĠwaitFor 1 0 Seconds () ĊĊĠĠĠ Ġ// ĠThere 's Ġnothing Ġleft Ġto Ġbe Ġreve aled . ĊĠĠĠ Ġverify No More Interactions ( mock Hint Monitor ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest View Solution _ solution Available _ wait 3 0 Sec _ monitor Not Called () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġtrigger And Re veal First Hint () ĊĠĠĠ Ġtrigger And Re veal Second Hint () ĊĠĠĠ Ġtrigger Solution () ĊĠĠĠ Ġhint Handler . view Solution () ĊĠĠĠ Ġreset ( mock Hint Monitor ) ĊĊĠĠĠ ĠwaitFor 3 0 Seconds () ĊĊĠĠĠ Ġ// ĠThere 's Ġnothing Ġleft Ġto Ġbe Ġreve aled . ĊĠĠĠ Ġverify No More Interactions ( mock Hint Monitor ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest View Solution _ solution Available _ wait 6 0 Sec _ monitor Not Called () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġtrigger And Re veal First Hint () ĊĠĠĠ Ġtrigger And Re veal Second Hint () ĊĠĠĠ Ġtrigger Solution () ĊĠĠĠ Ġhint Handler . view Solution () ĊĠĠĠ Ġreset ( mock Hint Monitor ) ĊĊĠĠĠ ĠwaitFor 6 0 Seconds () ĊĊĠĠĠ Ġ// ĠThere 's Ġnothing Ġleft Ġto Ġbe Ġreve aled . ĊĠĠĠ Ġverify No More Interactions ( mock Hint Monitor ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest View Solution _ everything View ed _ throws Exception () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġtrigger And Re veal First Hint () ĊĠĠĠ Ġtrigger And Re veal Second Hint () ĊĠĠĠ Ġtrigger And Re veal Solution () ĊĊĠĠĠ Ġval Ġexception Ġ= ĠassertThrows ( IllegalStateException :: class ) Ġ{ ĊĠĠĠĠĠ Ġhint Handler . view Solution () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ// ĠThe Ġsolution Ġhas Ġalready Ġbeen Ġreve aled . ĊĠĠĠ ĠassertThat ( exception ). has Message That (). contains (" Cannot Ġreveal Ġsolution ") ĊĠ Ġ} ĊĊĠ Ġ/* ĠTests Ġfor Ġnavigate To Previous State Ġ*/ ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Navigate To Previous State _ pending Hint _ wait 6 0 Sec _ monitor Not Called () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġreset ( mock Hint Monitor ) ĊĊĠĠĠ Ġhint Handler . navigate To Previous State () ĊĠĠĠ ĠwaitFor 6 0 Seconds () ĊĊĠĠĠ Ġ// ĠThe Ġmonitor Ġshould Ġnot Ġbe Ġcalled Ġsince Ġthe Ġuser Ġnavig ated Ġaway Ġfrom Ġthe Ġpending Ġstate . ĊĠĠĠ Ġverify No More Interactions ( mock Hint Monitor ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Navigate To Previous State _ multiple Times _ pending Hint _ wait 6 0 Sec _ monitor Not Called () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġreset ( mock Hint Monitor ) ĊĊĠĠĠ Ġ// ĠSim ulate Ġnavig ating Ġback Ġthree Ġstates . ĊĠĠĠ Ġhint Handler . navigate To Previous State () ĊĠĠĠ Ġhint Handler . navigate To Previous State () ĊĠĠĠ Ġhint Handler . navigate To Previous State () ĊĠĠĠ ĠwaitFor 6 0 Seconds () ĊĊĠĠĠ Ġ// ĠThe Ġmonitor Ġshould Ġnot Ġbe Ġcalled Ġsince Ġthe Ġpending Ġstate Ġisn 't Ġvisible . ĊĠĠĠ Ġverify No More Interactions ( mock Hint Monitor ) ĊĠ Ġ} ĊĊĠ Ġ/* ĠTests Ġfor Ġnavigate Back To Latest Pending State Ġ*/ ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Navigate Back To Latest Pending State _ from Previous State _ pending Hint _ monitor Not Called () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġhint Handler . navigate To Previous State () ĊĠĠĠ Ġreset ( mock Hint Monitor ) ĊĊĠĠĠ Ġhint Handler . navigate Back To Latest Pending State () ĊĊĠĠĠ Ġ// ĠThe Ġmonitor Ġshould Ġnot Ġbe Ġcalled Ġimmediately Ġafter Ġreturning Ġto Ġthe Ġpending Ġstate . ĊĠĠĠ Ġverify No More Interactions ( mock Hint Monitor ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Navigate Back To Latest Pending State _ from Previous State _ pending Hint _ wait 6 0 Sec _ monitor Called () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġhint Handler . navigate To Previous State () ĊĠĠĠ Ġhint Handler . navigate Back To Latest Pending State () ĊĠĠĠ Ġreset ( mock Hint Monitor ) ĊĊĠĠĠ ĠwaitFor 6 0 Seconds () ĊĊĠĠĠ Ġ// ĠThe Ġhint Ġshould Ġnot Ġbe Ġavailable Ġsince Ġthe Ġuser Ġhas Ġwait ed Ġfor Ġthe Ġcounter Ġto Ġfinish . ĊĠĠĠ Ġverify ( mock Hint Monitor ). on Help Index Changed () ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Navigate Back To Latest Pending State _ from Previous State _ wait Remaining Time _ monitor Not Called () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ ĠwaitFor 3 0 Seconds () ĊĠĠĠ Ġhint Handler . navigate To Previous State () ĊĠĠĠ Ġhint Handler . navigate Back To Latest Pending State () ĊĠĠĠ Ġreset ( mock Hint Monitor ) ĊĊĠĠĠ ĠwaitFor 3 0 Seconds () ĊĊĠĠĠ Ġ// ĠWaiting Ġhalf Ġthe Ġnecessary Ġtime Ġis Ġins ufficient Ġto Ġshow Ġthe Ġhint Ġ( since Ġthe Ġtimer Ġis Ġnot ĊĠĠĠ Ġ// Ġres umed , Ġit 's Ġreset Ġafter Ġreturning Ġthe Ġpending Ġstate ). ĊĠĠĠ Ġverify No More Interactions ( mock Hint Monitor ) ĊĠ Ġ} ĊĊĠ Ġ/* ĊĠĠ Ġ* ĠTests Ġfor ĠgetCurrent Help Index Ġ( more Ġdetailed Ġstate Ġmachine Ġtests ; Ġsome Ġmay Ġbe Ġredundant ĊĠĠ Ġ* Ġwith Ġearlier Ġtests ). ĠIt 's Ġsuggested Ġto Ġreference Ġthe Ġstate Ġmachine Ġdiagram Ġla id Ġout Ġin ĊĠĠ Ġ* ĠHint Handler 's Ġclass ĠK Doc Ġwhen Ġinspect ing Ġthe Ġfollowing Ġtests . ĊĠĠ Ġ*/ ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest GetCurrent Help Index _ initialState _ isEmpty () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĊĠĠĠ Ġval Ġhelp Index Ġ= Ġhint Handler . getCurrent Help Index () ĊĊĠĠĠ ĠassertThat ( help Index ). isEqualTo Default Instance () ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest GetCurrent Help Index _ wait 1 0 Sec _ isEmpty () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ ĠwaitFor 1 0 Seconds () ĊĊĠĠĠ Ġval Ġhelp Index Ġ= Ġhint Handler . getCurrent Help Index () ĊĊĠĠĠ ĠassertThat ( help Index ). isEqualTo Default Instance () ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest GetCurrent Help Index _ wait 3 0 Sec _ isEmpty () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ ĠwaitFor 3 0 Seconds () ĊĊĠĠĠ Ġval Ġhelp Index Ġ= Ġhint Handler . getCurrent Help Index () ĊĊĠĠĠ ĠassertThat ( help Index ). isEqualTo Default Instance () ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest GetCurrent Help Index _ wait 6 0 Sec _ has Available Hint () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ ĠwaitFor 6 0 Seconds () ĊĊĠĠĠ Ġval Ġhelp Index Ġ= Ġhint Handler . getCurrent Help Index () ĊĊĠĠĠ ĠassertThat ( help Index ). isEqualTo ( ĊĠĠĠĠĠ ĠHelp Index . newBuilder (). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġnext Available Hint Index Ġ= Ġ 0 ĊĠĠĠĠĠ Ġ}. build () ĊĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest GetCurrent Help Index _ one Wrong Answer _ isEmpty () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġhint Handler . handle Wrong Answer Submission ( wrong Answer Count Ġ= Ġ 1 ) ĊĊĠĠĠ Ġval Ġhelp Index Ġ= Ġhint Handler . getCurrent Help Index () ĊĊĠĠĠ ĠassertThat ( help Index ). isEqualTo Default Instance () ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest GetCurrent Help Index _ one Wrong Answer _ wait 1 0 Sec _ isEmpty () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġhint Handler . handle Wrong Answer Submission ( wrong Answer Count Ġ= Ġ 1 ) ĊĠĠĠ ĠwaitFor 1 0 Seconds () ĊĊĠĠĠ Ġval Ġhelp Index Ġ= Ġhint Handler . getCurrent Help Index () ĊĊĠĠĠ ĠassertThat ( help Index ). isEqualTo Default Instance () ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest GetCurrent Help Index _ one Wrong Answer _ wait 3 0 Sec _ isEmpty () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġhint Handler . handle Wrong Answer Submission ( wrong Answer Count Ġ= Ġ 1 ) ĊĠĠĠ ĠwaitFor 3 0 Seconds () ĊĊĠĠĠ Ġval Ġhelp Index Ġ= Ġhint Handler . getCurrent Help Index () ĊĊĠĠĠ ĠassertThat ( help Index ). isEqualTo Default Instance () ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest GetCurrent Help Index _ one Wrong Answer _ wait 6 0 Sec _ has Available Hint () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġhint Handler . handle Wrong Answer Submission ( wrong Answer Count Ġ= Ġ 1 ) ĊĠĠĠ ĠwaitFor 6 0 Seconds () ĊĊĠĠĠ Ġval Ġhelp Index Ġ= Ġhint Handler . getCurrent Help Index () ĊĊĠĠĠ ĠassertThat ( help Index ). isEqualTo ( ĊĠĠĠĠĠ ĠHelp Index . newBuilder (). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġnext Available Hint Index Ġ= Ġ 0 ĊĠĠĠĠĠ Ġ}. build () ĊĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest GetCurrent Help Index _ two Wrong Answers _ has Available Hint () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġhint Handler . handle Wrong Answer Submission ( wrong Answer Count Ġ= Ġ 1 ) ĊĠĠĠ Ġhint Handler . handle Wrong Answer Submission ( wrong Answer Count Ġ= Ġ 2 ) ĊĊĠĠĠ Ġval Ġhelp Index Ġ= Ġhint Handler . getCurrent Help Index () ĊĊĠĠĠ ĠassertThat ( help Index ). isEqualTo ( ĊĠĠĠĠĠ ĠHelp Index . newBuilder (). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġnext Available Hint Index Ġ= Ġ 0 ĊĠĠĠĠĠ Ġ}. build () ĊĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest GetCurrent Help Index _ with Available Hint _ another Wrong Answer _ has Same Available Hint () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġtrigger First Hint () ĊĠĠĠ Ġhint Handler . handle Wrong Answer Submission ( wrong Answer Count Ġ= Ġ 1 ) ĊĊĠĠĠ Ġval Ġhelp Index Ġ= Ġhint Handler . getCurrent Help Index () ĊĊĠĠĠ ĠassertThat ( help Index ). isEqualTo ( ĊĠĠĠĠĠ ĠHelp Index . newBuilder (). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġnext Available Hint Index Ġ= Ġ 0 ĊĠĠĠĠĠ Ġ}. build () ĊĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest GetCurrent Help Index _ view Available Hint _ has Shown Hint Index () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġtrigger And Re veal First Hint () ĊĊĠĠĠ Ġval Ġhelp Index Ġ= Ġhint Handler . getCurrent Help Index () ĊĊĠĠĠ ĠassertThat ( help Index ). isEqualTo ( ĊĠĠĠĠĠ ĠHelp Index . newBuilder (). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġlatest Re ve aled Hint Index Ġ= Ġ 0 ĊĠĠĠĠĠ Ġ}. build () ĊĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest GetCurrent Help Index _ view Available Hint _ wait 1 0 Sec _ has Shown Hint Index () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġtrigger And Re veal First Hint () ĊĠĠĠ ĠwaitFor 1 0 Seconds () ĊĊĠĠĠ Ġval Ġhelp Index Ġ= Ġhint Handler . getCurrent Help Index () ĊĊĠĠĠ ĠassertThat ( help Index ). isEqualTo ( ĊĠĠĠĠĠ ĠHelp Index . newBuilder (). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġlatest Re ve aled Hint Index Ġ= Ġ 0 ĊĠĠĠĠĠ Ġ}. build () ĊĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest GetCurrent Help Index _ view Available Hint _ wait 3 0 Sec _ has New Available Hint () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġtrigger And Re veal First Hint () ĊĠĠĠ ĠwaitFor 3 0 Seconds () ĊĊĠĠĠ Ġval Ġhelp Index Ġ= Ġhint Handler . getCurrent Help Index () ĊĊĠĠĠ ĠassertThat ( help Index ). isEqualTo ( ĊĠĠĠĠĠ ĠHelp Index . newBuilder (). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġnext Available Hint Index Ġ= Ġ 1 ĊĠĠĠĠĠ Ġ}. build () ĊĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest GetCurrent Help Index _ view Available Hint _ one Wrong Answer _ has Shown Hint Index () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġtrigger And Re veal First Hint () ĊĠĠĠ Ġhint Handler . handle Wrong Answer Submission ( wrong Answer Count Ġ= Ġ 1 ) ĊĊĠĠĠ Ġval Ġhelp Index Ġ= Ġhint Handler . getCurrent Help Index () ĊĊĠĠĠ ĠassertThat ( help Index ). isEqualTo ( ĊĠĠĠĠĠ ĠHelp Index . newBuilder (). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġlatest Re ve aled Hint Index Ġ= Ġ 0 ĊĠĠĠĠĠ Ġ}. build () ĊĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest GetCurrent Help Index _ view Available Hint _ one Wrong Answer _ wait 1 0 Sec _ has New Available Hint () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġtrigger And Re veal First Hint () ĊĠĠĠ Ġhint Handler . handle Wrong Answer Submission ( wrong Answer Count Ġ= Ġ 1 ) ĊĠĠĠ ĠwaitFor 1 0 Seconds () ĊĊĠĠĠ Ġval Ġhelp Index Ġ= Ġhint Handler . getCurrent Help Index () ĊĊĠĠĠ ĠassertThat ( help Index ). isEqualTo ( ĊĠĠĠĠĠ ĠHelp Index . newBuilder (). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġnext Available Hint Index Ġ= Ġ 1 ĊĠĠĠĠĠ Ġ}. build () ĊĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest GetCurrent Help Index _ view Available Hint _ two Wrong Answers _ has Shown Hint Index () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġtrigger And Re veal First Hint () ĊĠĠĠ Ġhint Handler . handle Wrong Answer Submission ( wrong Answer Count Ġ= Ġ 1 ) ĊĠĠĠ Ġhint Handler . handle Wrong Answer Submission ( wrong Answer Count Ġ= Ġ 2 ) ĊĊĠĠĠ Ġval Ġhelp Index Ġ= Ġhint Handler . getCurrent Help Index () ĊĊĠĠĠ Ġ// ĠMultiple Ġwrong Ġanswers Ġdo Ġnot Ġforce Ġa Ġhint Ġto Ġbe Ġshown Ġexcept Ġfor Ġthe Ġfirst Ġhint . ĊĠĠĠ ĠassertThat ( help Index ). isEqualTo ( ĊĠĠĠĠĠ ĠHelp Index . newBuilder (). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġlatest Re ve aled Hint Index Ġ= Ġ 0 ĊĠĠĠĠĠ Ġ}. build () ĊĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest GetCurrent Help Index _ view Available Hint _ two Wrong Answers _ wait 1 0 Sec _ has New Available Hint () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġtrigger And Re veal First Hint () ĊĠĠĠ Ġhint Handler . handle Wrong Answer Submission ( wrong Answer Count Ġ= Ġ 1 ) ĊĠĠĠ Ġhint Handler . handle Wrong Answer Submission ( wrong Answer Count Ġ= Ġ 2 ) ĊĠĠĠ ĠwaitFor 1 0 Seconds () ĊĊĠĠĠ Ġval Ġhelp Index Ġ= Ġhint Handler . getCurrent Help Index () ĊĊĠĠĠ ĠassertThat ( help Index ). isEqualTo ( ĊĠĠĠĠĠ ĠHelp Index . newBuilder (). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġnext Available Hint Index Ġ= Ġ 1 ĊĠĠĠĠĠ Ġ}. build () ĊĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest GetCurrent Help Index _ all Hints View ed _ no Solution _ everything Re ve aled () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With One Hint And No Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĊĠĠĠ Ġtrigger And Re veal First Hint () ĊĊĠĠĠ Ġ// ĠAll Ġhints Ġhave Ġbeen Ġviewed Ġfor Ġthis Ġstate , Ġso Ġnothing Ġremains . ĊĠĠĠ ĠassertThat ( hint Handler . getCurrent Help Index ()). isEqualTo ( ĊĠĠĠĠĠ ĠHelp Index . newBuilder (). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġeverything Re ve aled Ġ= Ġtrue ĊĠĠĠĠĠ Ġ}. build () ĊĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest GetCurrent Help Index _ all Hints View ed _ last Index View ed () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġtrigger And Re veal First Hint () ĊĠĠĠ Ġtrigger And Re veal Second Hint () ĊĊĠĠĠ Ġval Ġhelp Index Ġ= Ġhint Handler . getCurrent Help Index () ĊĊĠĠĠ ĠassertThat ( help Index ). isEqualTo ( ĊĠĠĠĠĠ ĠHelp Index . newBuilder (). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġlatest Re ve aled Hint Index Ġ= Ġ 1 ĊĠĠĠĠĠ Ġ}. build () ĊĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest GetCurrent Help Index _ all Hints View ed _ wait 1 0 Sec _ last Index View ed () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġtrigger And Re veal First Hint () ĊĠĠĠ Ġtrigger And Re veal Second Hint () ĊĠĠĠ ĠwaitFor 1 0 Seconds () ĊĊĠĠĠ Ġval Ġhelp Index Ġ= Ġhint Handler . getCurrent Help Index () ĊĊĠĠĠ ĠassertThat ( help Index ). isEqualTo ( ĊĠĠĠĠĠ ĠHelp Index . newBuilder (). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġlatest Re ve aled Hint Index Ġ= Ġ 1 ĊĠĠĠĠĠ Ġ}. build () ĊĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest GetCurrent Help Index _ all Hints View ed _ wait 3 0 Sec _ can Show Solution () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġtrigger And Re veal First Hint () ĊĠĠĠ Ġtrigger And Re veal Second Hint () ĊĠĠĠ ĠwaitFor 3 0 Seconds () ĊĊĠĠĠ Ġval Ġhelp Index Ġ= Ġhint Handler . getCurrent Help Index () ĊĊĠĠĠ ĠassertThat ( help Index ). isEqualTo ( ĊĠĠĠĠĠ ĠHelp Index . newBuilder (). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġshow Solution Ġ= Ġtrue ĊĠĠĠĠĠ Ġ}. build () ĊĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest GetCurrent Help Index _ all Hints View ed _ wait 3 0 Sec _ reveal Solution _ everything Re ve aled () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġtrigger And Re veal First Hint () ĊĠĠĠ Ġtrigger And Re veal Second Hint () ĊĠĠĠ ĠwaitFor 3 0 Seconds () ĊĠĠĠ Ġhint Handler . view Solution () ĊĊĠĠĠ Ġval Ġhelp Index Ġ= Ġhint Handler . getCurrent Help Index () ĊĊĠĠĠ ĠassertThat ( help Index ). isEqualTo ( ĊĠĠĠĠĠ ĠHelp Index . newBuilder (). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġeverything Re ve aled Ġ= Ġtrue ĊĠĠĠĠĠ Ġ}. build () ĊĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest GetCurrent Help Index _ all Hints View ed _ one Wrong Answer _ last Index View ed () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġtrigger And Re veal First Hint () ĊĠĠĠ Ġtrigger And Re veal Second Hint () ĊĠĠĠ Ġhint Handler . handle Wrong Answer Submission ( wrong Answer Count Ġ= Ġ 1 ) ĊĊĠĠĠ Ġval Ġhelp Index Ġ= Ġhint Handler . getCurrent Help Index () ĊĊĠĠĠ ĠassertThat ( help Index ). isEqualTo ( ĊĠĠĠĠĠ ĠHelp Index . newBuilder (). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġlatest Re ve aled Hint Index Ġ= Ġ 1 ĊĠĠĠĠĠ Ġ}. build () ĊĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest GetCurrent Help Index _ all Hints View ed _ one Wrong Answer _ wait 1 0 Sec _ can Show Solution () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġtrigger And Re veal First Hint () ĊĠĠĠ Ġtrigger And Re veal Second Hint () ĊĠĠĠ Ġhint Handler . handle Wrong Answer Submission ( wrong Answer Count Ġ= Ġ 1 ) ĊĠĠĠ ĠwaitFor 1 0 Seconds () ĊĊĠĠĠ Ġval Ġhelp Index Ġ= Ġhint Handler . getCurrent Help Index () ĊĊĠĠĠ ĠassertThat ( help Index ). isEqualTo ( ĊĠĠĠĠĠ ĠHelp Index . newBuilder (). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġshow Solution Ġ= Ġtrue ĊĠĠĠĠĠ Ġ}. build () ĊĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest GetCurrent Help Index _ all Hints View ed _ two Wrong Answers _ last Index View ed () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġtrigger And Re veal First Hint () ĊĠĠĠ Ġtrigger And Re veal Second Hint () ĊĠĠĠ Ġhint Handler . handle Wrong Answer Submission ( wrong Answer Count Ġ= Ġ 1 ) ĊĠĠĠ Ġhint Handler . handle Wrong Answer Submission ( wrong Answer Count Ġ= Ġ 2 ) ĊĊĠĠĠ Ġval Ġhelp Index Ġ= Ġhint Handler . getCurrent Help Index () ĊĊĠĠĠ Ġ// ĠMultiple Ġsubsequent Ġwrong Ġanswers Ġonly Ġaffects Ġthe Ġfirst Ġhint . ĊĠĠĠ ĠassertThat ( help Index ). isEqualTo ( ĊĠĠĠĠĠ ĠHelp Index . newBuilder (). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġlatest Re ve aled Hint Index Ġ= Ġ 1 ĊĠĠĠĠĠ Ġ}. build () ĊĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest GetCurrent Help Index _ all Hints View ed _ two Wrong Answers _ wait 1 0 Sec _ can Show Solution () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With Hints And Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġtrigger And Re veal First Hint () ĊĠĠĠ Ġtrigger And Re veal Second Hint () ĊĠĠĠ Ġhint Handler . handle Wrong Answer Submission ( wrong Answer Count Ġ= Ġ 1 ) ĊĠĠĠ Ġhint Handler . handle Wrong Answer Submission ( wrong Answer Count Ġ= Ġ 2 ) ĊĠĠĠ ĠwaitFor 1 0 Seconds () ĊĊĠĠĠ Ġval Ġhelp Index Ġ= Ġhint Handler . getCurrent Help Index () ĊĊĠĠĠ ĠassertThat ( help Index ). isEqualTo ( ĊĠĠĠĠĠ ĠHelp Index . newBuilder (). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġshow Solution Ġ= Ġtrue ĊĠĠĠĠĠ Ġ}. build () ĊĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest GetCurrent Help Index _ only Solution _ isEmpty () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With No Hints And One Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĊĠĠĠ Ġval Ġhelp Index Ġ= Ġhint Handler . getCurrent Help Index () ĊĊĠĠĠ ĠassertThat ( help Index ). isEqualTo Default Instance () ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest GetCurrent Help Index _ only Solution _ wait 1 0 Sec _ isEmpty () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With No Hints And One Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ ĠwaitFor 1 0 Seconds () ĊĊĠĠĠ Ġval Ġhelp Index Ġ= Ġhint Handler . getCurrent Help Index () ĊĊĠĠĠ ĠassertThat ( help Index ). isEqualTo Default Instance () ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest GetCurrent Help Index _ only Solution _ wait 3 0 Sec _ isEmpty () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With No Hints And One Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ ĠwaitFor 3 0 Seconds () ĊĊĠĠĠ Ġval Ġhelp Index Ġ= Ġhint Handler . getCurrent Help Index () ĊĊĠĠĠ ĠassertThat ( help Index ). isEqualTo Default Instance () ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest GetCurrent Help Index _ only Solution _ wait 6 0 Sec _ can Show Solution () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With No Hints And One Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ ĠwaitFor 6 0 Seconds () ĊĊĠĠĠ Ġval Ġhelp Index Ġ= Ġhint Handler . getCurrent Help Index () ĊĊĠĠĠ ĠassertThat ( help Index ). isEqualTo ( ĊĠĠĠĠĠ ĠHelp Index . newBuilder (). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġshow Solution Ġ= Ġtrue ĊĠĠĠĠĠ Ġ}. build () ĊĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest GetCurrent Help Index _ only Solution _ one Wrong Answer _ isEmpty () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With No Hints And One Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġhint Handler . handle Wrong Answer Submission ( wrong Answer Count Ġ= Ġ 1 ) ĊĊĠĠĠ Ġval Ġhelp Index Ġ= Ġhint Handler . getCurrent Help Index () ĊĊĠĠĠ ĠassertThat ( help Index ). isEqualTo Default Instance () ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest GetCurrent Help Index _ only Solution _ one Wrong Answer _ wait 1 0 Sec _ isEmpty () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With No Hints And One Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġhint Handler . handle Wrong Answer Submission ( wrong Answer Count Ġ= Ġ 1 ) ĊĠĠĠ ĠwaitFor 1 0 Seconds () ĊĊĠĠĠ Ġval Ġhelp Index Ġ= Ġhint Handler . getCurrent Help Index () ĊĊĠĠĠ ĠassertThat ( help Index ). isEqualTo Default Instance () ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest GetCurrent Help Index _ only Solution _ one Wrong Answer _ wait 3 0 Sec _ isEmpty () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With No Hints And One Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġhint Handler . handle Wrong Answer Submission ( wrong Answer Count Ġ= Ġ 1 ) ĊĠĠĠ ĠwaitFor 3 0 Seconds () ĊĊĠĠĠ Ġval Ġhelp Index Ġ= Ġhint Handler . getCurrent Help Index () ĊĊĠĠĠ ĠassertThat ( help Index ). isEqualTo Default Instance () ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest GetCurrent Help Index _ only Solution _ one Wrong Answer _ wait 6 0 Sec _ can Show Solution () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With No Hints And One Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġhint Handler . handle Wrong Answer Submission ( wrong Answer Count Ġ= Ġ 1 ) ĊĠĠĠ ĠwaitFor 6 0 Seconds () ĊĊĠĠĠ Ġval Ġhelp Index Ġ= Ġhint Handler . getCurrent Help Index () ĊĊĠĠĠ ĠassertThat ( help Index ). isEqualTo ( ĊĠĠĠĠĠ ĠHelp Index . newBuilder (). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġshow Solution Ġ= Ġtrue ĊĠĠĠĠĠ Ġ}. build () ĊĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest GetCurrent Help Index _ only Solution _ two Wrong Answers _ can Show Solution () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With No Hints And One Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ Ġhint Handler . handle Wrong Answer Submission ( wrong Answer Count Ġ= Ġ 1 ) ĊĠĠĠ Ġhint Handler . handle Wrong Answer Submission ( wrong Answer Count Ġ= Ġ 2 ) ĊĊĠĠĠ Ġval Ġhelp Index Ġ= Ġhint Handler . getCurrent Help Index () ĊĊĠĠĠ ĠassertThat ( help Index ). isEqualTo ( ĊĠĠĠĠĠ ĠHelp Index . newBuilder (). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġshow Solution Ġ= Ġtrue ĊĠĠĠĠĠ Ġ}. build () ĊĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest GetCurrent Help Index _ only Solution _ triggered And Re ve aled _ everything Is Re ve aled () Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġexp With No Hints And One Solution . get InitialState () ĊĠĠĠ Ġhint Handler . start Watch ing For Hints In New State ( state ) ĊĠĠĠ ĠwaitFor 6 0 Seconds () ĊĠĠĠ Ġhint Handler . view Solution () ĊĊĠĠĠ Ġval Ġhelp Index Ġ= Ġhint Handler . getCurrent Help Index () ĊĊĠĠĠ ĠassertThat ( help Index ). isEqualTo ( ĊĠĠĠĠĠ ĠHelp Index . newBuilder (). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġeverything Re ve aled Ġ= Ġtrue ĊĠĠĠĠĠ Ġ}. build () ĊĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun ĠEx ploration . get InitialState (): ĠState Ġ= Ġstates Map . getValue ( init State Name ) ĊĊĠ Ġprivate Ġfun Ġtrigger First Hint () Ġ= ĠwaitFor 6 0 Seconds () ĊĊĠ Ġprivate Ġfun Ġtrigger Second Hint () Ġ= ĠwaitFor 3 0 Seconds () ĊĊĠ Ġprivate Ġfun Ġtrigger Solution () Ġ= ĠwaitFor 3 0 Seconds () ĊĊĠ Ġprivate Ġfun Ġtrigger And Re veal First Hint () Ġ{ ĊĠĠĠ Ġtrigger First Hint () ĊĠĠĠ Ġhint Handler . view Hint ( hint Index Ġ= Ġ 0 ) ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġtrigger And Re veal Second Hint () Ġ{ ĊĠĠĠ Ġtrigger Second Hint () ĊĠĠĠ Ġhint Handler . view Hint ( hint Index Ġ= Ġ 1 ) ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġtrigger And Re veal Solution () Ġ{ ĊĠĠĠ Ġtrigger Solution () ĊĠĠĠ Ġhint Handler . view Solution () ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġtrigger And Re veal Everything In Multi Hint State () Ġ{ ĊĠĠĠ Ġtrigger And Re veal First Hint () ĊĠĠĠ Ġtrigger And Re veal Second Hint () ĊĠĠĠ Ġtrigger And Re veal Solution () ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun ĠwaitFor 1 0 Seconds () Ġ= ĠwaitFor ( seconds Ġ= Ġ 1 0 ) ĊĊĠ Ġprivate Ġfun ĠwaitFor 3 0 Seconds () Ġ= ĠwaitFor ( seconds Ġ= Ġ 3 0 ) ĊĊĠ Ġprivate Ġfun ĠwaitFor 6 0 Seconds () Ġ= ĠwaitFor ( seconds Ġ= Ġ 6 0 ) ĊĊĠ Ġprivate Ġfun ĠwaitFor ( seconds : ĠLong ) Ġ{ ĊĠĠĠ Ġ// ĠThere 's Ġa Ġweird Ġqu irk Ġat Ġthe Ġmoment Ġwhere Ġthe Ġinitial Ġcoroutine Ġdoesn 't Ġstart Ġwithout Ġa ĊĠĠĠ Ġ// Ġrun Current (). ĠThis Ġseems Ġa Ġbit Ġlike Ġa Ġbug Ġwithin Ġthe Ġdispatch ers ; Ġit Ġshould Ġprobably Ġflush ĊĠĠĠ Ġ// Ġcurrent Ġtasks Ġbefore Ġadv ancing Ġtime . ĊĠĠĠ Ġ// ĠTODO (# 3 7 0 0 ): ĠFix Ġthis Ġbehavior Ġ( once Ġfixed , Ġ' run Current ' Ġshould Ġbe Ġable Ġto Ġbe Ġremoved Ġbelow ). ĊĠĠĠ Ġtest Coroutine Dispatch ers . run Current () ĊĠĠĠ Ġtest Coroutine Dispatch ers . advance Time By ( TimeUnit . SECONDS . to Millis ( seconds )) ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun ĠsetUp Test Application Component () Ġ{ ĊĠĠĠ ĠApplication Provider . getApplicationContext < Test Application >(). inject ( this ) ĊĠ Ġ} ĊĊĠ Ġ// ĠTODO (# 8 9 ): ĠMove Ġthis Ġto Ġa Ġcommon Ġtest Ġapplication Ġcomponent . ĊĠ Ġ@ Module ĊĠ Ġclass ĠTest Module Ġ{ ĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġfun Ġprovide Context ( application : ĠApplication ): ĠContext Ġ= Ġapplication ĊĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġ@ Load Lesson Protos From Assets ĊĠĠĠ Ġfun Ġprovide Load Lesson Protos From Assets ( test Environment Config : ĠTest Environment Config ): ĠBoolean Ġ= ĊĠĠĠĠĠ Ġtest Environment Config . is Using B azel () ĊĠ Ġ} ĊĊĠ Ġ@ Singleton ĊĠ Ġ@ Component ( ĊĠĠĠ Ġmodules Ġ= Ġ[ ĊĠĠĠĠĠ ĠTest Module :: class , ĠH ints And Solution Prod Module :: class , ĠH ints And Solution Config Module :: class , ĊĠĠĠĠĠ ĠTest Log Reporting Module :: class , ĠTest Dispatcher Module :: class , ĠRo bo lectric Module :: class , ĊĠĠĠĠĠ ĠLogger Module :: class ĊĠĠĠ Ġ] ĊĠ Ġ) ĊĠ Ġinterface ĠTest Application Component Ġ: ĠData Providers Injector Ġ{ ĊĠĠĠ Ġ@ Component . Builder ĊĠĠĠ Ġinterface ĠBuilder Ġ{ ĊĠĠĠĠĠ Ġ@ Bind s Instance ĊĠĠĠĠĠ Ġfun Ġset Application ( application : ĠApplication ): ĠBuilder ĊĊĠĠĠĠĠ Ġfun Ġbuild (): ĠTest Application Component ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġinject ( hint Handler Prod Impl Test : ĠHint Handler Prod Impl Test ) ĊĠ Ġ} ĊĊĠ Ġclass ĠTest Application Ġ: ĠApplication (), ĠData Providers Injector Provider Ġ{ ĊĠĠĠ Ġprivate Ġval Ġcomponent : ĠTest Application Component Ġby Ġlazy Ġ{ ĊĠĠĠĠĠ ĠD agger Hint Handler Prod Impl Test _ Test Application Component . builder () ĊĠĠĠĠĠĠĠ Ġ. set Application ( this ) ĊĠĠĠĠĠĠĠ Ġ. build () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġinject ( hint Handler Prod Impl Test : ĠHint Handler Prod Impl Test ) Ġ{ ĊĠĠĠĠĠ Ġcomponent . inject ( hint Handler Prod Impl Test ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun ĠgetData Providers Injector (): ĠData Providers Injector Ġ= Ġcomponent ĊĠ Ġ} Ċ } Ċ