TMTextUnitVariantCommentAnnotations extends GenericAnnotations { public boolean hasCommentWithErrorSeverity() { return hasCommentWithSeverity(TMTextUnitVariantComment.Severity.ERROR); } TMTextUnitVariantCommentAnnotations(TextContainer textContainer); boolean hasCommentWithErrorSeverity(); boolean hasCommentWithWarningSeverity(); List<TMTextUnitVariantCommentAnnotation> getAnnotations(); void addAnnotation(TMTextUnitVariantCommentAnnotation tmTextUnitVariantCommentAnnotation);  }
@Test public void testHasCommentWithErrorSeverity() { TextContainer target = new TextContainer(); TMTextUnitVariantCommentAnnotations tmTextUnitVariantCommentAnnotations = new TMTextUnitVariantCommentAnnotations(target); List<TMTextUnitVariantCommentAnnotation> annotations = tmTextUnitVariantCommentAnnotations.getAnnotations(); Assert.assertEquals(0, annotations.size()); TMTextUnitVariantCommentAnnotation tmTextUnitVariantCommentAnnotation1 = new TMTextUnitVariantCommentAnnotation(); tmTextUnitVariantCommentAnnotation1.setSeverity(TMTextUnitVariantComment.Severity.ERROR); tmTextUnitVariantCommentAnnotations.addAnnotation(tmTextUnitVariantCommentAnnotation1); Assert.assertTrue(tmTextUnitVariantCommentAnnotations.hasCommentWithErrorSeverity()); Assert.assertFalse(tmTextUnitVariantCommentAnnotations.hasCommentWithWarningSeverity()); }