boolean seenDogs = false;
TermAttribute termAtt = (TermAttribute) ttf.addAttribute(TermAttribute.class);
TypeAttribute typeAtt = (TypeAttribute) ttf.addAttribute(TypeAttribute.class);
ttf.reset();
while (ttf.incrementToken()) {
if (termAtt.term().equals("dogs")) {
seenDogs = true;
assertTrue(typeAtt.type() + " is not equal to " + "D", typeAtt.type().equals("D") == true);
} else {
assertTrue(typeAtt.type() + " is not null and it should be", typeAtt.type().equals("word"));