implement a basic in memory database by java