InMemoryUnitsDAO implements UnitsDAO { @Override public void addUnitsFromTSV(Reader reader) throws IOException, URISyntaxException { BufferedReader br = new BufferedReader(reader); String l; while ((l = br.readLine()) != null) { String[] columnDetail = l.split("\t", -1); URI documentURI = new URI(columnDetail[0]); int begin = Integer.parseInt(columnDetail[1]); int end = Integer.parseInt(columnDetail[2]); String annotatorId = columnDetail[3]; String annotatorClass = columnDetail[4]; this.addUnitItem(documentURI, begin, end, annotatorId, annotatorClass); } }  @Override void addUnitItem(URI documentURI, int begin, int end,
                            String annotatorId, String annotatorClass); @Override Iterable<Unit> getUnits(); @Override void toTSV(Writer writer); @Override void addUnitsFromTSV(Reader reader);  }
@Test public void testAddUnitsFromTSV() throws URISyntaxException, IOException { UnitsDAO daoFromTSV = new InMemoryUnitsDAO(); daoFromTSV.addUnitsFromTSV(new StringReader(daoToString())); assertUnits(daoFromTSV); }