Java program to fetch unique words from a paragraph..
Write a function that accepts two parameters. The first parameter is a String representing a bunch of sentences (like a paragraph) and the second parameter is an int. The function should return a List<String> of unique words, from the input string. The list should be sorted based on the second parameter. If the second parameter is 1, then the list is ordered in alphabetical order. If it is 2, then the list is ordered based on the word length. If the word lengths of two or more words are same, then they must be ordered alphabetically...I had writen the code.But I am not getting full marks for it..Some eval test cases and eval unit tests are failing..The code is for my training purposes..Eval test cases are not visible to us..so can anyone help me?.