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 = "resourcesWithClashingNamesDataProvider")
  public void testResourceNameClash(Class<?>[] classes)
  {
    Set<Class<?>> resourceClasses = new HashSet<>(Arrays.<Class<?>>asList(classes));
    try
    {
      RestLiApiBuilder.buildResourceModels(resourceClasses);
      Assert.fail("API generation should have failed due to name clashes!");
    }
    catch (ResourceConfigException e)
    {
      Assert.assertTrue(e.getMessage().contains("clash on the resource name \"foo\""),
                        "The exception did not contain the expected resource name clashing error message.");
    }
  }