code: public static void ensureContentType(CDAEntry entry, CDAClient client) {
      CDAContentType contentType = entry.contentType();
      if (contentType != null) {
        return;
      }
  
      String contentTypeId = extractNested(entry.attrs(), "contentType", "sys", "id");
      try {
        contentType = client.cacheTypeWithId(contentTypeId).blockingFirst();
      } catch (CDAResourceNotFoundException e) {
        throw new CDAContentTypeNotFoundException(entry.id(), CDAEntry.class, contentTypeId, e);
      }
  
      entry.setContentType(contentType);
    }
docs: Make sure that the given entry has a filled in content type.
  
  @param entry  entry to be filled
  @param client to be used if more content types need to be requested.