how to sort words alphabetically in java