### Question:
ElasticsearchTypeUtils { private Extractor makeFloat4Extractor(Field field) { return (Float4Extractor) (Object context, NullableFloat4Holder dst) -> { Object fieldValue = ((Map) context).get(field.getName()); dst.isSet = 1; if (fieldValue instanceof Number) { dst.value = ((Number) fieldValue).floatValue(); } else if (fieldValue instanceof String) { dst.value = new Float((String) fieldValue); } else if (fieldValue instanceof List) { Object value = ((List) fieldValue).get(0); if (value instanceof Number) { dst.value = ((Number) value).floatValue(); } else if (value instanceof String) { dst.value = new Float((String) value); } else { dst.isSet = 0; } } else { dst.isSet = 0; } }; } protected  ElasticsearchTypeUtils();   }### Answer:
@Test public void makeFloat4ExtractorTest() throws Exception { logger.info("makeFloat4ExtractorTest - enter"); mapping = SchemaBuilder.newBuilder() .addField("myfloat", Types.MinorType.FLOAT4.getType()) .addField("myfloatstring", Types.MinorType.FLOAT4.getType()) .addField("myfloatlist", Types.MinorType.FLOAT4.getType()) .addField("myfloatstringlist", Types.MinorType.FLOAT4.getType()) .build(); Map <String, Object> document = new ObjectMapper().readValue( "{\n" + " \"myfloat\" : 529.84,\n" + " \"myfloatstring\" : \"764.25\",\n" + " \"myfloatlist\" : [\n" + " 23,\n" + " 2\n" + " ],\n" + " \"myfloatstringlist\" : [\n" + " \"45\",\n" + " \"4\"\n" + " ]\n" + "}\n", HashMap.class); Map<String, Object> expectedResults = ImmutableMap.of( "myfloat", new Float(529.84), "myfloatstring", new Float(764.25), "myfloatlist", new Float(23.0), "myfloatstringlist", new Float(45.0)); Map<String, Object> extractedResults = testField(mapping, document); logger.info("makeFloat4ExtractorTest - Expected: {}, Extracted: {}", expectedResults, extractedResults); assertEquals("Extracted results are not as expected!", expectedResults, extractedResults); logger.info("makeFloat4ExtractorTest - exit"); }