### Question:
JsonAnalyzer extends Analyzer { public void registerDatatype(final char[] datatype, final Analyzer a) { if (!regAnalyzers.containsKey(datatype)) { regAnalyzers.put(datatype, a); } } JsonAnalyzer(final Version version, final Analyzer fieldAnalyzer,
                      final Analyzer valueAnalyzer); void setValueAnalyzer(final Analyzer analyzer); void setFieldAnalyzer(final Analyzer analyzer); void registerDatatype(final char[] datatype, final Analyzer a); void clearDatatypes();  }### Answer:
@Test public void testLong() throws Exception { _a.registerDatatype(XSDDatatype.XSD_LONG.toCharArray(), new StandardAnalyzer(TEST_VERSION_CURRENT)); this.assertAnalyzesTo(_a, "{\"foo\":12}", new String[] { "foo", "12" }, new String[] { TypeAttribute.DEFAULT_TYPE, "<NUM>" }); }
@Test public void testDouble() throws Exception { _a.registerDatatype(XSDDatatype.XSD_DOUBLE.toCharArray(), new StandardAnalyzer(TEST_VERSION_CURRENT)); this.assertAnalyzesTo(_a, "{\"foo\":12.42}", new String[] { "foo", "12.42" }, new String[] { TypeAttribute.DEFAULT_TYPE, "<NUM>" }); }
@Test public void testBoolean() throws Exception { _a.registerDatatype(XSDDatatype.XSD_BOOLEAN.toCharArray(), new WhitespaceAnalyzer(TEST_VERSION_CURRENT)); this.assertAnalyzesTo(_a, "{\"foo\":[true,false]}", new String[] { "foo", "true", "false" }, new String[] { TypeAttribute.DEFAULT_TYPE, TypeAttribute.DEFAULT_TYPE, TypeAttribute.DEFAULT_TYPE }); }