Return Object Keys Javascript Substring Function In Java