Here you can find the source of loadList(String listName)
public static Set<String> loadList(String listName) throws FileNotFoundException, IOException
//package com.java2s; //License from project: Open Source License import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.util.HashSet; import java.util.Set; public class Main { public static Set<String> loadList(String listName) throws FileNotFoundException, IOException { Set<String> list = new HashSet<String>(); File file = new File(listName); if (file.exists()) { try (BufferedReader br = new BufferedReader( new FileReader(file))) { for (String line; (line = br.readLine()) != null;) list.add(line.trim().toLowerCase()); }// w w w .j a v a 2 s. com } return list; } }