### Question:
TagExtractor { public void clear() { buf_ = new StringBuffer(); tag_ = null; } TagExtractor(String tag, int threshold); int count(); void clear(); void setTag(String tag); void add(String line); String closeTag();  }### Answer:
@Test public final void testClear() { TagExtractor extractor = new TagExtractor("abstract", 10); extractor.setTag("abstract"); extractor.add("This is a sample text."); assertEquals(extractor.buf_.toString(), "This is a sample text."); assertEquals(extractor.tag_, "abstract"); extractor.clear(); assertEquals(extractor.buf_.toString(), ""); assertEquals(extractor.tag_, null); }