I am trying to read names in from a second file but only pick 10 randomly from each file for a total of 20 in the same output file. But can't figure out how to read from a second file and put into the same output.

```
public class example2 {

    public static void main(String[] args) throws IOException
    {
// Read in the file into a list of strings
        BufferedReader reader = new BufferedReader(new FileReader("textfile.txt"));
//BufferedWriter bw = new BufferedWriter(new FileWriter("out.txt"));
        List<String> lines = new ArrayList<String>();

        String line = reader.readLine();

        while( line != null ) {
            lines.add(line);
            line = reader.readLine();
        }

        try (BufferedWriter writer = new BufferedWriter(new FileWriter("randomNames.txt"))) {

            Random random = new Random();
            Set<String> usedNames = new HashSet<String>(20);

            while (usedNames.size() < 20) {
                int rowNum = random.nextInt(lines.size());
                String name = lines.get(rowNum);
                if (!containsNameWithSameFirstCharacter(usedNames, name)) {
                    usedNames.add(name);
                    writer.write(name);
                    writer.newLine();
                }
            }
            writer.flush();
        }

    }
    private static boolean containsNameWithSameFirstCharacter(Collection<String> names, String name) {
        for (String anotherName: names) {
            if (anotherName.charAt(0) == name.charAt(0)) {
                return true;
            }
        }
        return false;
    }
}

```