### Question:
PedFileReader { public PedFileContents read() throws IOException, PedParseException { return read(new FileInputStream(file)); } PedFileReader(File file); PedFileContents read(); static PedFileContents read(InputStream stream);  }### Answer:
@Test public void testParseWithHeader() throws PedParseException, IOException { PedFileReader reader = new PedFileReader(this.tmpFileWithHeader); PedFileContents pedFileContents = reader.read(); Assert.assertEquals(pedFileContents.getExtraColumnHeaders().size(), 0); ImmutableList.Builder<PedPerson> individuals = new ImmutableList.Builder<PedPerson>(); individuals.add(new PedPerson("fam", "father", "0", "0", Sex.MALE, Disease.UNKNOWN)); individuals.add(new PedPerson("fam", "mother", "0", "0", Sex.FEMALE, Disease.UNKNOWN)); individuals.add(new PedPerson("fam", "son", "father", "mother", Sex.MALE, Disease.UNKNOWN)); individuals.add(new PedPerson("fam", "daughter", "father", "mother", Sex.FEMALE, Disease.UNKNOWN)); Assert.assertEquals(pedFileContents.getIndividuals(), individuals.build()); }
@Test public void testParseWithoutHeader() throws PedParseException, IOException { PedFileReader reader = new PedFileReader(this.tmpFileWithoutHeader); PedFileContents pedFileContents = reader.read(); Assert.assertEquals(pedFileContents.getExtraColumnHeaders().size(), 0); ImmutableList.Builder<PedPerson> individuals = new ImmutableList.Builder<PedPerson>(); individuals.add(new PedPerson("fam", "father", "0", "0", Sex.MALE, Disease.UNKNOWN)); individuals.add(new PedPerson("fam", "mother", "0", "0", Sex.FEMALE, Disease.UNKNOWN)); individuals.add(new PedPerson("fam", "son", "father", "mother", Sex.MALE, Disease.UNKNOWN)); individuals.add(new PedPerson("fam", "daughter", "father", "mother", Sex.FEMALE, Disease.UNKNOWN)); Assert.assertEquals(pedFileContents.getIndividuals(), individuals.build()); }