If this answer helps you, please mark it as an answer. 😉
There are a couple of ways that you can go about this depending on your needs and if you are interested is saving all of the graphics in a layer at once, or if you need to save them one at a time...
1) Use a FeatureSet. Add all of graphics to a FeatureSet and then use FeatureSet.toJson() to serialize it and FeatureSet.fromJson() to deserialize it.
2) Serialize the main components of an individual graphic separately (if all you care about is geometry and you are programmatically defining a symbol, you don't really need to worry about saving the symbol or attributes).
[INDENT]a) Geometry: use GeometryEngine.geometryToJson() / GeometryEngine.jsonToGeometry()
b) Symbol: use Symbol.toJson() / SymbolHelper.createSymbol()
c) Attributes: use new JSONObject(graphic.getAttributes()).toString() / new JSONObject(jsonAttributes)[/INDENT]
In the case of the attributes for option #2, when you deserialize them you'll have to loop through jsonObject.keys() and build a Map<String, Object> of attributes to use when recreating the graphic.