code: private EntityMetadata metadata(final Class<?> source) {
          EntityMetadata metadata = metadataCache.get(source);
  
          if (metadata == null) {
              EntityMetadata generated = new ReflectionBasedEntityMetadata(source);
              metadataCache.put(source, generated);
              return generated;
          } else {
              return metadata;
          }
      }
docs: Helper method to return and cache the entity metadata.
  
  @param source the source class.
  @return the metadata.