code: public PagedList<ServiceEndpointPolicyDefinitionInner> listByResourceGroup(final String resourceGroupName, final String serviceEndpointPolicyName) {
          ServiceResponse<Page<ServiceEndpointPolicyDefinitionInner>> response = listByResourceGroupSinglePageAsync(resourceGroupName, serviceEndpointPolicyName).toBlocking().single();
          return new PagedList<ServiceEndpointPolicyDefinitionInner>(response.body()) {
              @Override
              public Page<ServiceEndpointPolicyDefinitionInner> nextPage(String nextPageLink) {
                  return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body();
              }
          };
      }
docs: Gets all service endpoint policy definitions in a service end point policy.
  
  @param resourceGroupName The name of the resource group.
  @param serviceEndpointPolicyName The name of the service endpoint policy name.
  @throws IllegalArgumentException thrown if parameters fail the validation
  @throws CloudException thrown if the request is rejected by server
  @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
  @return the PagedList&lt;ServiceEndpointPolicyDefinitionInner&gt; object if successful.