Kata implementing a checkout in java and scala