public void testExplicitIgnoralWithMap() throws Exception { // test simulating need to filter out metadata like class name MyMap value = new MyMap(); value.put("a", "b"); value.put("@class", MyMap.class.getName()); Map<String, Object> result = writeAndMap(MAPPER, value); assertEquals(1, result.size()); // verify that specified field is ignored assertFalse(result.containsKey("@class")); // and that others are not assertEquals(value.get("a"), result.get("a")); }