code: private static Type extractEntityTypeFromReturnType(HttpResponseDecodeData decodeData) {
          Type token = decodeData.returnType();
          if (token != null) {
              if (TypeUtil.isTypeOrSubTypeOf(token, Mono.class)) {
                  token = TypeUtil.getTypeArgument(token);
              } else if (TypeUtil.isTypeOrSubTypeOf(token, Flux.class)) {
                  Type t = TypeUtil.getTypeArgument(token);
                  try {
                      // TODO: anuchan - unwrap OperationStatus a different way
                      // Check for OperationStatus<?>
                      if (TypeUtil.isTypeOrSubTypeOf(t, Class.forName("com.azure.common.mgmt.OperationStatus"))) {
                          token = t;
                      }
                  } catch (ClassNotFoundException ignored) {
                  }
              }
  
              if (TypeUtil.isTypeOrSubTypeOf(token, Response.class)) {
                  token = TypeUtil.getRestResponseBodyType(token);
              }
  
              try {
                  // TODO: anuchan - unwrap OperationStatus a different way
                  if (TypeUtil.isTypeOrSubTypeOf(token, Class.forName("com.azure.common.mgmt.OperationStatus"))) {
                      // Get Type of 'T' from OperationStatus<T>
                      token = TypeUtil.getTypeArgument(token);
                  }
              } catch (Exception ignored) {
              }
          }
          return token;
      }
docs: Get the {@link Type} of the REST API 'returned entity'.
  
  In the declaration of a java proxy method corresponding to the REST API, the 'returned entity' can be:
  
  1. emission value of the reactor publisher returned by proxy method
  
  e.g. {@code Mono<Foo> getFoo(args);}
  {@code Flux<Foo> getFoos(args);}
  where Foo is the REST API 'returned entity'.
  
  2. OR content (value) of {@link ResponseBase} emitted by the reactor publisher returned from proxy method
  
  e.g. {@code Mono<RestResponseBase<headers, Foo>> getFoo(args);}
  {@code Flux<RestResponseBase<headers, Foo>> getFoos(args);}
  where Foo is the REST API return entity.
  
  @return the entity type.