JSONSerializer serializer =
new JSONSerializer()
.transform(new StateTransformer(), State.class)
.transform(new StringArrayTransformer(), String[].class)
.exclude("loopClassOnes.loopClassTwo.loopClassOne")
.rootName("myRootName")
.prettyPrint(true);
serializer.deepSerialize(person, writer);