public static Map<String, ResourceModel> buildResourceModels(final Set<Class<?>> restliAnnotatedClasses)
  {
    Map<String, ResourceModel> rootResourceModels = new HashMap<>();
    Map<Class<?>, ResourceModel> resourceModels = new HashMap<>();

    for (Class<?> annotatedClass : restliAnnotatedClasses)
    {
      processResourceInOrder(annotatedClass, resourceModels, rootResourceModels);
    }

    return rootResourceModels;
  }
@Test(dataProvider = "actionReturnTypeData")
  public void testActionReturnType(Class<?> resourceClass, Class<?> expectedActionReturnType)
  {
    // Process the resource and collect the resource method descriptors
    Map<String, ResourceModel> models = RestLiApiBuilder.buildResourceModels(Collections.singleton(resourceClass));
    Assert.assertEquals(models.size(), 1);
    ResourceModel model = models.get(models.keySet().iterator().next());
    Assert.assertNotNull(model);
    List<ResourceMethodDescriptor> resourceMethodDescriptors = model.getResourceMethodDescriptors();

    // For each method, check that the action return type was correctly identified
    for (ResourceMethodDescriptor resourceMethodDescriptor : resourceMethodDescriptors)
    {
      Class<?> logicalReturnType = resourceMethodDescriptor.getActionReturnType();
      Assert.assertEquals(resourceMethodDescriptor.getActionReturnType(), expectedActionReturnType);
    }
  }