Text file in Java Set <String> using Commons or Guava
4 answers
With Apache Commons IO , you have readLines which returns a List . Then you can add all the elements from the returned list to the HashSet (be careful: combine the type between List and Set and lose duplicate lines).
0