Preview:
def groovyObject
String json

// Groovy -> JSON
import groovy.json.JsonOutput
json = JsonOutput.prettyPrint(JsonOutput.toJson(groovyObject))

// Quick println
println groovy.json.JsonOutput.prettyPrint(groovy.json.JsonOutput.toJson(groovyObject))

// JSON -> Groovy
import groovy.json.JsonSlurper
def jsonSlurper = new JsonSlurper()
groovyObject = jsonSlurper.parseText(json)
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter