GrobidRestUtils { public static Annotation getAnnotationFor(int type) { GrobidRestUtils.Annotation annotType = null; if (type == 0) annotType = GrobidRestUtils.Annotation.CITATION; else if (type == 1) annotType = GrobidRestUtils.Annotation.BLOCK; else if (type == 2) annotType = GrobidRestUtils.Annotation.FIGURE; return annotType; }  static boolean isResultNullOrEmpty(String result); static Annotation getAnnotationFor(int type);  }
@Test public void getAnnotationFor_validType_shouldWork() throws Exception { assertThat(GrobidRestUtils.getAnnotationFor(1), is(GrobidRestUtils.Annotation.BLOCK)); assertThat(GrobidRestUtils.getAnnotationFor(2), is(GrobidRestUtils.Annotation.FIGURE)); assertThat(GrobidRestUtils.getAnnotationFor(0), is(GrobidRestUtils.Annotation.CITATION)); }
@Test public void getAnnotationFor_invalidType_shouldWork() throws Exception { assertNull(GrobidRestUtils.getAnnotationFor(-1)); assertNull(GrobidRestUtils.getAnnotationFor(4)); assertNull(GrobidRestUtils.getAnnotationFor(3)); }