private static JsonNode serialize(StateMachine stateMachine) {
        try {
            return MAPPER.readTree(stateMachine.toJson());
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
Serializes StateMachine into pretty formatted JSON and deserialize back into a StateMachine from the JSON.

@param stateMachine State machine to round trip.
@return Round-tripped state machine.
aws-java-sdk-stepfunctions/src/test/java/com/amazonaws/services/stepfunctions/builder/StatesAsserts.java