Map<String, Object> props = new HashMap<String, Object>();
props.put("profile", "default");
props.put("someBool", true);
Operation operation = new Operation("add", address, props);
operation.addAdditionalProperty("foo", "bar");
ObjectMapper mapper = new ObjectMapper();
String result = mapper.writeValueAsString(operation);
assertFalse(result.contains("name"), "Result contains a name property but should not, " + result);
assertFalse(result.contains("null"), "Result contains null values but should not, " + result);
Operation op = mapper.readValue(result, Operation.class);
assertEquals(op.getOperation(), operation.getOperation(), "Operation is " + op.getOperation());
assertTrue(op.getAdditionalProperties().containsKey("someBool"), "Key someBool not found ");
Object someBool = op.getAdditionalProperties().get("someBool");
assertTrue((Boolean) someBool, "someBool was not true");
}