How do I modify OCGs in a source PDF?

Q: The order array object for OCGs in a source PDF might look like
this:

44 0 obj
[42 0 R[[(Quadrangle Location)7 0 R[8 0 R 9 0 R]][(UTM Grid and
Projection)10 0 R[11 0 R[12 0 R 13 0 R[14 0 R 15 0 R]16 0 R 17 0 R]]]
[(Adjoining Quadrangles Diagram)18 0 R[19 0 R 20 0 R]][(Map Layers)21
0 R[22 0 R[23 0 R]24 0 R[25 0 R[26 0 R 27 0 R]]28 0 R[29 0 R[30 0 R 31
0 R]32 0 R[33 0 R 34 0 R 35 0 R 36 0 R]]]37 0 R[38 0 R 39 0 R 40 0 R
41 0 R]]]43 0 R]
endobj

Part of what we want to accomplish is to add a few more objects,
remove a few of the objects, and get this:

44 0 obj
[656 0 R [657 0 R] 658 0 R[11 0 R[ 12 0 R 13 0 R 16 0 R 17 0 R]24 0 R
[25 0 R]22 0 R[23 0 R] 28 0 R[32 0 R 29 0 R]] 660 0 R[43 0 R]]
endobj

Do you happen to have an example how to do this with the Java
code ?
-------------------------
A: As a starting point you may want to take a look at PDFLayers sample
project:
   http://www.pdftron.com/pdfnet/samplecode.html#PDFLayers

For example:
Obj ocgs = doc.getOCGs(); // Get the array of all OCGs in the
document.
if (ocgs != null) {
  ocgs.pushFront(image_layer.getSDFObj());
  ocgs.pushFront(vector_layer.getSDFObj());
  ocgs.pushBack(text_layer.getSDFObj());
  ocgs.eraseAt(4); // erase fourth element in the array
  … etc
}