how to check whether two strings are anagrams in java