public void testNumericScalars() throws Exception {
  ObjectMapper m=new ObjectMapper();
  m.enableDefaultTyping();
  assertEquals("[123]",m.writeValueAsString(new Object[]{Integer.valueOf(123)}));
  assertEquals("[[\"java.lang.Long\",37]]",m.writeValueAsString(new Object[]{Long.valueOf(37)}));
  assertEquals("[0.25]",m.writeValueAsString(new Object[]{Double.valueOf(0.25)}));
  assertEquals("[[\"java.lang.Float\",0.5]]",m.writeValueAsString(new Object[]{Float.valueOf(0.5f)}));
}

public void testNumericScalars ( ) throws Exception { ObjectMapper m = new ObjectMapper ( ) ; m . enableDefaultTyping ( ) ; assertEquals ( "[123]" , m . writeValueAsString ( new Object [ ] { Integer . valueOf ( 123 ) } ) ) ; assertEquals ( "[[\"java.lang.Long\",37]]" , m . writeValueAsString ( new Object [ ] { Long . valueOf ( 37 ) } ) ) ; assertEquals ( "[0.25]" , m . writeValueAsString ( new Object [ ] { Double . valueOf ( 0.25 ) } ) ) ; assertEquals ( "[[\"java.lang.Float\",0.5]]" , m . writeValueAsString ( new Object [ ] { Float . valueOf ( 0.5f ) } ) ) ; }
unit test to verify that limited number of core types do not include type information , even if declared as object . this is only done for types that json scalar values natively map to : string , integer and boolean ( and nulls never have type information )
