class UpdateDeserializer extends JsonDeserializer<Update<?>> implements ContextualDeserializer {

    @Override
    public Update<?> deserialize(JsonParser parser, DeserializationContext ctx) throws IOException {
        ObjectMapper mapper = (ObjectMapper) parser.getCodec();

        JsonNode node = mapper.readTree(parser);

        ImmutableSet.Builder<String> setFields = ImmutableSet.builder();
        ImmutableSet.Builder<String> removeFields = ImmutableSet.builder();
        Map<String,JsonNode> setNodes = new HashMap<>();

        Iterator<String> iter = node.fieldNames();
        while (iter.hasNext()) {
            String field = iter.next();
            JsonNode value = node.get(field);
            if (value instanceof NullNode) {
                removeFields.add(field);
            } else if (value instanceof TextNode && value.toString().equals("\"\"")) {
                removeFields.add(field);
            } else {
                setFields.add(field);
                setNodes.put(field, value);
            }
        }
        Object setObject = mapper.convertValue(setNodes, valueType);

        return Update.of(setObject, setFields.build(), removeFields.build());
    }

}