ChunkSample { @Override public String toString() { StringBuilder chunkString = new StringBuilder(); for (int ci=0; ci < preds.size(); ci++) { chunkString.append(sentence.get(ci)).append(" ").append(tags.get(ci)).append(" ").append(preds.get(ci)).append("\n"); } return chunkString.toString(); } ChunkSample(String[] sentence, String[] tags, String[] preds);  ChunkSample(List<String> sentence, List<String> tags, List<String> preds); String[] getSentence(); String[] getTags(); String[] getPreds(); Span[] getPhrasesAsSpanList(); static Span[] phrasesAsSpanList(String[] aSentence, String[] aTags,
      String[] aPreds); String nicePrint(); @Override String toString(); @Override boolean equals(Object obj);  }
@Test public void testToString() throws IOException { ChunkSample sample = new ChunkSample(createSentence(), createTags(), createChunks()); String[] sentence = createSentence(); String[] tags = createTags(); String[] chunks = createChunks(); StringReader sr = new StringReader(sample.toString()); BufferedReader reader = new BufferedReader(sr); for (int i = 0; i < sentence.length; i++) { String line = reader.readLine(); String[] parts = line.split("\\s+"); assertEquals(3, parts.length); assertEquals(sentence[i], parts[0]); assertEquals(tags[i], parts[1]); assertEquals(chunks[i], parts[2]); } }