### Question:
LinkFileWriter { public void write(Record r1, Record r2, boolean match, double confidence) throws IOException { write(getid(r1), getid(r2), match, confidence); } LinkFileWriter(Writer out);  LinkFileWriter(Writer out, Configuration config); void write(Record r1, Record r2, boolean match, double confidence); void write(String id1, String id2, boolean match, double confidence);  }### Answer:
@Test public void testSingleLink() throws IOException { out.write("1", "2", true, 0.95); writer.close(); load(); assertEquals(1, db.getAllLinks().size()); Link link = db.getAllLinks().iterator().next(); verifySame(new Link("1", "2", LinkStatus.ASSERTED, LinkKind.SAME, 0.95), link); }
@Test public void testThreeLink() throws IOException { out.write("1", "2", true, 0.95); out.write("1", "3", false, 0.2); out.write("3", "4", true, 0.8); writer.close(); load(); assertEquals(3, db.getAllLinks().size()); Collection<Link> links = db.getAllLinks(); Link link = find(links, "1", "2"); verifySame(new Link("1", "2", LinkStatus.ASSERTED, LinkKind.SAME, 0.95), link); link = find(links, "1", "3"); verifySame(new Link("1", "3", LinkStatus.ASSERTED, LinkKind.DIFFERENT, 0.2), link); link = find(links, "3", "4"); verifySame(new Link("3", "4", LinkStatus.ASSERTED, LinkKind.SAME, 0.8), link); }