@Test public void content() { assertThat(analyser.getContents("")).isEqualTo("comment"); assertThat(analyser.getContents("")).isEqualTo(" comment "); assertThat(analyser.getContents("<!--comment-->")).isEqualTo("comment"); assertThat(analyser.getContents("<!-- comment -->")).isEqualTo(" comment "); }
@Override public String getContents(String comment) { if (comment.startsWith("/*")) { return comment.substring(2, comment.length() - 2); } else if (comment.startsWith("<!--")) { return comment.substring(4, comment.length() - 3); } else { throw new IllegalArgumentException(); } }
CssCommentAnalyser extends CommentAnalyser { @Override public String getContents(String comment) { if (comment.startsWith("/*")) { return comment.substring(2, comment.length() - 2); } else if (comment.startsWith("<!--")) { return comment.substring(4, comment.length() - 3); } else { throw new IllegalArgumentException(); } } }
CssCommentAnalyser extends CommentAnalyser { @Override public String getContents(String comment) { if (comment.startsWith("/*")) { return comment.substring(2, comment.length() - 2); } else if (comment.startsWith("<!--")) { return comment.substring(4, comment.length() - 3); } else { throw new IllegalArgumentException(); } }  }
CssCommentAnalyser extends CommentAnalyser { @Override public String getContents(String comment) { if (comment.startsWith("/*")) { return comment.substring(2, comment.length() - 2); } else if (comment.startsWith("<!--")) { return comment.substring(4, comment.length() - 3); } else { throw new IllegalArgumentException(); } }  @Override boolean isBlank(String line); @Override String getContents(String comment); }
CssCommentAnalyser extends CommentAnalyser { @Override public String getContents(String comment) { if (comment.startsWith("/*")) { return comment.substring(2, comment.length() - 2); } else if (comment.startsWith("<!--")) { return comment.substring(4, comment.length() - 3); } else { throw new IllegalArgumentException(); } }  @Override boolean isBlank(String line); @Override String getContents(String comment);  }