Altimetrik Interview Question

Java Code - {"eat, ate, tab, bat"} - to Group (Segregate) Anagrams