final PositionIncrementAttribute posIncrAtt = t.getAttribute(PositionIncrementAttribute.class);
t.setReader(new StringReader(uri));
t.reset();
final TokenFilter filter = new MailtoFilter(t);
for (int i = 0; i < expectedStems.length; i++) {
assertTrue("token " + i + " exists", filter.incrementToken());
assertEquals(expectedStems[i], termAtt.toString());
if (expectedTypes == null)
assertEquals(uritype, typeAtt.type());
else
assertEquals(expectedTypes[i], typeAtt.type());
if (expectedPosIncr != null)
assertEquals(expectedPosIncr[i], posIncrAtt.getPositionIncrement());
}
filter.end();
filter.close();
}