read from txt and add to treeset
<p>I need to read a txt file and store my data to a treeSet. </p>

<pre><code>public class UrbanPopulationStatistics {

private Set&lt;UrbanPopulation&gt; popSet;
private File file;
private BufferedReader br;

public UrbanPopulationStatistics(String fileName) throws IOException {

    this.popSet = new TreeSet&lt;&gt;();

    readFile("population.txt");
}

private void readFile(String fileName) throws IOException {


    try {
        br = new BufferedReader(new FileReader(fileName));
         String line;
        while ((line=br.readLine()) != null) {


            String[] array = line.split("/");

            popSet.add(new UrbanPopulation(array[0], Integer.parseInt(array[1]), Integer.parseInt(array[4])));

        }
    } catch (IOException e) {
        e.printStackTrace();
    }
    br.close();
}

@Override
public String toString() {
    String s = popSet.toString().replaceAll(", ", "");
    return "UrbanPopulationStatistics:\n" + s.substring(1, s.length() - 1) + "\n";
}


public static void main(String[] args) throws IOException {
    UrbanPopulationStatistics stats = new UrbanPopulationStatistics("population.txt");
    System.out.println(stats);
}

}
</code></pre>

<p>I have tried to turn what the buffered reader reads into an array and then add it into my treeSet, but I get the error: Exception in thread "main" java.lang.UnsupportedOperationException: Not supported yet.</p>