revere string recursively and java map problem