Through Scanner enter any text, it turns out the line:
Scanner reader = new Scanner(System.in); String number = reader.nextLine(); There is also a collection with results:
Set<String> result = new HashSet<>(); It is necessary to check, by entering text, whether there is an input value in the collection.
Under the condition if (number.equals(result)) - the types are different, therefore it does not compare.
How can you compare?