code: private <T> T getInstance(DatastoreType datastoreType, TransactionalCache.Mode cacheMode) {
          DatastoreId id = getDatastoreId(datastoreType);
          Object instance = cache.get(id, cacheMode);
          if (instance == null) {
              DynamicType<?> types = getTypes(datastoreType);
              instance = newInstance(id, datastoreType, types, cacheMode);
              if (TransactionalCache.Mode.READ.equals(cacheMode)) {
                  instanceListenerService.postLoad(instance);
              }
          }
          return (T) instance;
      }
docs: Return the proxy instance which corresponds to the given datastore type.
  
  @param datastoreType
  The datastore type.
  @param <T>
  The instance type.
  @return The instance.