Code Kata Four in java following the repository pattern