code: @SuppressWarnings("unchecked") // always have unchecked casts when dealing with raw classes
      private Geometry decodeObject(final List mongoDBGeometry, final List<GeometryFactory> geometryFactories) {
          GeometryFactory factory = geometryFactories.get(0);
          if (geometryFactories.size() == 1) {
              // This should be the last list, so no need to decode further
              return factory.createGeometry(mongoDBGeometry);
          } else {
              List<Geometry> decodedObjects = new ArrayList<Geometry>();
              for (final Object objectThatNeedsDecoding : mongoDBGeometry) {
                  // MongoDB geometries are lists of lists of lists...
                  decodedObjects.add(decodeObject((List) objectThatNeedsDecoding,
                                                  geometryFactories.subList(1, geometryFactories.size())));
              }
              return factory.createGeometry(decodedObjects);
          }
      }
docs: /*
  We're expecting a List that can be turned into a geometry using a series of factories