I am relatively new to java and I have a task where I have to remove consecutive duplicates which are entered as standard input (e.g. a text.txt). For example 1 2 2 3 3 4 5