question: public void testIntBooleanMap ( ) throws Exception { ObjectMapper mapper = new ObjectMapper ( ) ; String JSON = "{ \"1\" : true, \"-1\" : false }" ; Map < String , Integer > result = mapper . readValue ( JSON , new TypeReference < HashMap < Integer , Boolean > > ( ) { } ) ; assertNotNull ( result ) ; assertEquals ( HashMap . class , result . getClass ( ) ) ; assertEquals ( 2 , result . size ( ) ) ; assertEquals ( Boolean . TRUE , result . get ( Integer . valueOf ( 1 ) ) ) ; assertEquals ( Boolean . FALSE , result . get ( Integer . valueOf ( - 1 ) ) ) ; assertNull ( result . get ( "foobar" ) ) ; assertNull ( result . get ( 0 ) ) ; }
target:  Let's also check that it is possible to do type conversions to allow use of non-String Map keys.