### Question:
URILocalnameFilterFactory extends TokenFilterFactory { @Override public TokenStream create(final TokenStream input) { final URILocalnameFilter filter = new URILocalnameFilter(input); filter.setMaxLength(maxLength); return filter; } URILocalnameFilterFactory(final Map<String,String> args); @Override TokenStream create(final TokenStream input); static final String MAXLENGTH_KEY; }### Answer:
@Test public void testMaxLength() throws Exception { final Map<String,String> args = this.getDefaultInitArgs(); args.put(URILocalnameFilterFactory.MAXLENGTH_KEY, "8"); final URILocalnameFilterFactory factory = new URILocalnameFilterFactory(args); final Reader reader = new StringReader("{ \"uri\" : \"http: final TokenStream stream = factory.create(new ExtendedJsonTokenizer(reader)); this.assertTokenStreamContents(stream, new String[] { "uri", "anotherLocalname", "http: }