The validation is a bit off. As it claims I do not close the stream. But maybe I am not allowed to use a TreeMap for this task?