private static HashSet<String> loadStringsFromFile(String filename) {
    HashSet<String> result = new HashSet<String>();

    try {
      FileReader fr = new FileReader(filename);
      BufferedReader bfr = new BufferedReader(fr);

      String line;

      while (null != (line = bfr.readLine())) {
        result.add(line);
      }

      fr.close();
    } catch (IOException ex) {
      // Let the exception percolate up as a RuntimeException.
      throw new RuntimeException("Error with optimize list: " + filename, ex);
    }

    return result;
  }
Loads a list of newline-separated strings into a new HashSet and returns the HashSet.

@param filename filename to process
@return set of all unique lines in the file
android/android_framework/dex-maker/src/main/java/com/android/dx/dex/cf/OptimizerOptions.java