CommentUtil { @Deprecated public static List<String> trim(List<String> lines) { return Comment.trim(lines); } private  CommentUtil(); @Deprecated // will be removed with PMD 7.0.0 static String wordAfter(String text, int position); @Deprecated // will be removed with PMD 7.0.0 static String javadocContentAfter(String text, int position); @Deprecated // will be removed with PMD 7.0.0 static Map<String, Integer> javadocTagsIn(String comment); @Deprecated // will be removed with PMD 7.0.0 static List<String> multiLinesIn(String comment); @Deprecated // will be removed with PMD 7.0.0 static List<String> trim(List<String> lines);  }
@Test public void testTrim() { List<String> lines = Arrays.asList("", "a", "", ""); List<String> trimmed = CommentUtil.trim(lines); Assert.assertEquals(1, trimmed.size()); Assert.assertEquals("a", trimmed.get(0)); }
@Test public void testTrimNotMiddle() { List<String> lines = Arrays.asList("a", "b", "", "c"); List<String> trimmed = CommentUtil.trim(lines); Assert.assertEquals(4, trimmed.size()); Assert.assertEquals("a", trimmed.get(0)); Assert.assertEquals("b", trimmed.get(1)); Assert.assertEquals("", trimmed.get(2)); Assert.assertEquals("c", trimmed.get(3)); }
@Test public void testTrimEmpty() { List<String> trimmed = CommentUtil.trim(new ArrayList<String>()); Assert.assertEquals(0, trimmed.size()); }
@Test public void testTrimNull() { List<String> trimmed = CommentUtil.trim(null); Assert.assertEquals(0, trimmed.size()); }