Memento in java , not compiling as the code is in one file