@@ -0,0 +1,1627 @@
+package com.pengyifan.brat;%0A%0Aimport static org.junit.Assert.assertEquals;%0A%0Aimport java.io.File;%0Aimport java.io.FileNotFoundException;%0Aimport java.io.FileReader;%0Aimport java.io.IOException;%0Aimport java.net.URL;%0A%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0Aimport com.google.common.testing.EqualsTester;%0Aimport com.pengyifan.brat.io.BratIOUtils;%0A%0Apublic class BratDocumentTest %7B%0A%0A  private static final String ANN_FILE = %22example1.ann%22;%0A  %0A  private static final String TEXT = %22ABC%22;%0A  private static final String DOC_ID = %22id%22;%0A  %0A  private static final String TEXT_2 = %22EFG%22;%0A  private static final String DOC_ID_2 = %22id2%22;%0A%0A  private BratDocument base;%0A%0A  @Before%0A  public void setUp()%0A      throws FileNotFoundException, IOException %7B%0A    URL url = this.getClass().getResource(%22/%22 + ANN_FILE);%0A    File expected = new File(url.getFile());%0A    base = BratIOUtils.read(new FileReader(expected), DOC_ID);%0A    base.setText(TEXT);%0A  %7D%0A  %0A  @Test%0A  public void test_allFields() %7B%0A    assertEquals(DOC_ID, base.getDocId());%0A    assertEquals(TEXT, base.getText());%0A  %7D%0A%0A  @Test%0A  public void test_equals() %7B%0A    BratDocument baseCopy = new BratDocument(base);%0A%0A    BratDocument diffId = new BratDocument(base);%0A    diffId.setDocId(DOC_ID_2);%0A%0A    BratDocument diffText = new BratDocument(base);%0A    diffText.setText(TEXT_2);%0A%0A    new EqualsTester()%0A        .addEqualityGroup(base, baseCopy)%0A        .addEqualityGroup(diffId)%0A        .addEqualityGroup(diffText)%0A        .testEquals();%0A  %7D%0A%0A  @Test%0A  public void test_getAnnotation() %7B%0A    BratAnnotation ann = base.getAnnotation(%22T1%22);%0A    assertEquals(%22T1%22, ann.getId());%0A  %7D%0A%7D%0A

test cases