### Question:
ElasticsearchTypeUtils { private Extractor makeTinyIntExtractor(Field field) { return (TinyIntExtractor) (Object context, NullableTinyIntHolder dst) -> { Object fieldValue = ((Map) context).get(field.getName()); dst.isSet = 1; if (fieldValue instanceof Number) { dst.value = ((Number) fieldValue).byteValue(); } else if (fieldValue instanceof String) { dst.value = new Double((String) fieldValue).byteValue(); } else if (fieldValue instanceof List) { Object value = ((List) fieldValue).get(0); if (value instanceof Number) { dst.value = ((Number) value).byteValue(); } else if (value instanceof String) { dst.value = new Double((String) value).byteValue(); } else { dst.isSet = 0; } } else { dst.isSet = 0; } }; } protected  ElasticsearchTypeUtils();   }### Answer:
@Test public void makeTinyIntExtractorTest() throws Exception { logger.info("makeTinyIntExtractorTest - enter"); mapping = SchemaBuilder.newBuilder() .addField("mybyte", Types.MinorType.TINYINT.getType()) .addField("mybytestring", Types.MinorType.TINYINT.getType()) .addField("mybytelist", Types.MinorType.TINYINT.getType()) .addField("mybytestringlist", Types.MinorType.TINYINT.getType()) .build(); Map <String, Object> document = new ObjectMapper().readValue( "{\n" + " \"mybyte\" : 5,\n" + " \"mybytestring\" : \"6.5\",\n" + " \"mybytelist\" : [\n" + " 1.5,\n" + " 2\n" + " ],\n" + " \"mybytestringlist\" : [\n" + " \"3.3\",\n" + " \"4\"\n" + " ]\n" + "}\n", HashMap.class); Map<String, Object> expectedResults = ImmutableMap.of( "mybyte", new Byte((byte)5), "mybytestring", new Byte((byte)6), "mybytelist", new Byte((byte) 1), "mybytestringlist", new Byte((byte) 3)); Map<String, Object> extractedResults = testField(mapping, document); logger.info("makeTinyIntExtractorTest - Expected: {}, Extracted: {}", expectedResults, extractedResults); assertEquals("Extracted results are not as expected!", expectedResults, extractedResults); logger.info("makeTinyIntExtractorTest - exit"); }