public void testSneakyBeanProperties() throws Exception {
  ObjectMapper mapper=new ObjectMapper();
  StringLongMapBean bean=mapper.readValue("{\"value\":{\"a\":123}}",StringLongMapBean.class);
  assertNotNull(bean);
  Map<String,Long> map=bean.value;
  assertEquals(1,map.size());
  assertEquals(Long.valueOf(123),map.get("a"));
  StringListBean bean2=mapper.readValue("{\"value\":[\"...\"]}",StringListBean.class);
  assertNotNull(bean2);
  List<String> list=bean2.value;
  assertSame(GenericList.class,list.getClass());
  assertEquals(1,list.size());
  assertEquals("...",list.get(0));
}

public void testSneakyBeanProperties ( ) throws Exception { ObjectMapper mapper = new ObjectMapper ( ) ; StringLongMapBean bean = mapper . readValue ( "{\"value\":{\"a\":123}}" , StringLongMapBean . class ) ; assertNotNull ( bean ) ; Map < String , Long > map = bean . value ; assertEquals ( 1 , map . size ( ) ) ; assertEquals ( Long . valueOf ( 123 ) , map . get ( "a" ) ) ; StringListBean bean2 = mapper . readValue ( "{\"value\":[\"...\"]}" , StringListBean . class ) ; assertNotNull ( bean2 ) ; List < String > list = bean2 . value ; assertSame ( GenericList . class , list . getClass ( ) ) ; assertEquals ( 1 , list . size ( ) ) ; assertEquals ( "..." , list . get ( 0 ) ) ; }
looks like type handling actually differs for properties , too .
