private AddServiceRequest serialize(AddServiceRequest request) throws IOException {
    String serialized = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(request);
    return mapper.readValue(serialized, AddServiceRequest.class);
  }
Tests for {@link AddServiceRequest} serialization / deserialization / syntax validation
ambari-server/src/test/java/org/apache/ambari/server/topology/addservice/AddServiceRequestTest.java