Implement test cases in MemoryTest.java