Added curly braces to if-else statements and  Replaced "Collections.EMPTY_SET" with "Collections.emptySet()". and  "Collections.EMPTY_LIST with "Collections.emptyList()".