### Question:
ElasticsearchTypeUtils { private Extractor makeIntExtractor(Field field) { return (IntExtractor) (Object context, NullableIntHolder dst) -> { Object fieldValue = ((Map) context).get(field.getName()); dst.isSet = 1; if (fieldValue instanceof Number) { dst.value = ((Number) fieldValue).intValue(); } else if (fieldValue instanceof String) { dst.value = new Double((String) fieldValue).intValue(); } else if (fieldValue instanceof List) { Object value = ((List) fieldValue).get(0); if (value instanceof Number) { dst.value = ((Number) value).intValue(); } else if (value instanceof String) { dst.value = new Double((String) value).intValue(); } else { dst.isSet = 0; } } else { dst.isSet = 0; } }; } protected  ElasticsearchTypeUtils();   }### Answer:
@Test public void makeIntExtractorTest() throws Exception { logger.info("makeIntExtractorTest - enter"); mapping = SchemaBuilder.newBuilder() .addField("myint", Types.MinorType.INT.getType()) .addField("myintstring", Types.MinorType.INT.getType()) .addField("myintlist", Types.MinorType.INT.getType()) .addField("myintstringlist", Types.MinorType.INT.getType()) .build(); Map <String, Object> document = new ObjectMapper().readValue( "{\n" + " \"myint\" : 5329347.8910,\n" + " \"myintstring\" : \"0479374.55\",\n" + " \"myintlist\" : [\n" + " 472394.342,\n" + " 1000304594\n" + " ],\n" + " \"myintstringlist\" : [\n" + " \"34875934.33\",\n" + " \"33433535\"\n" + " ]\n" + "}\n", HashMap.class); Map<String, Object> expectedResults = ImmutableMap.of( "myint", new Integer(5329347), "myintstring", new Integer(479374), "myintlist", new Integer(472394), "myintstringlist", new Integer(34875934)); Map<String, Object> extractedResults = testField(mapping, document); logger.info("makeIntExtractorTest - Expected: {}, Extracted: {}", expectedResults, extractedResults); assertEquals("Extracted results are not as expected!", expectedResults, extractedResults); logger.info("makeIntExtractorTest - exit"); }