code: @Override
      public ContentModelInfo getContentModelInfo(String pid)
              throws ObjectSourceException, InvalidContentModelException {
          try {
              ObjectInfo object = getValidationObject(pid);
              if (object == null) {
                  return null;
              }
  
              DatastreamInfo dsInfo =
                      object.getDatastreamInfo(DS_COMPOSITE_MODEL);
              if (dsInfo == null) {
                  throw new InvalidContentModelException(pid,
                                                         "Content model has no '"
                                                                 + DS_COMPOSITE_MODEL
                                                                 + "' datastream.");
              }
  
              if (!DS_COMPOSITE_MODEL_FORMAT.equals(dsInfo.getFormatUri())) {
                  throw new InvalidContentModelException(pid, "Datastream '"
                          + DS_COMPOSITE_MODEL + "' has incorrect format URI: '"
                          + dsInfo.getFormatUri() + "'.");
              }
  
              MIMETypedStream ds =
                      apia.getDatastreamDissemination(pid,
                                                      DS_COMPOSITE_MODEL,
                                                      null);
              DsCompositeModelDoc model =
                      new DsCompositeModelDoc(pid,
                                              org.fcrepo.server.utilities.TypeUtility
                                                      .convertDataHandlerToBytes(ds
                                                              .getStream()));
              return new BasicContentModelInfo(object, model.getTypeModels());
          } catch (Exception e) {
              throw new ObjectSourceException("Problem fetching '"
                                                      + DS_COMPOSITE_MODEL
                                                      + "' datastream for pid='"
                                                      + pid + "'",
                                              e);
          }
      }
docs: A content model must exist as an object. If must have a (@link
  DS_COMPOSITE_MODEL} datastream.