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 = "misconfiguredServiceErrorData")
  public void testMisconfiguredServiceErrors(Class<?> resourceClass, String expectedPartialMessage)
  {
    try
    {
      RestLiApiBuilder.buildResourceModels(Collections.singleton(resourceClass));
      Assert.fail(String.format("Expected %s for misconfigured service errors.", ResourceConfigException.class.getSimpleName()));
    }
    catch (ResourceConfigException e)
    {
      Assert.assertTrue(e.getMessage().contains(expectedPartialMessage),
          String.format("Expected %s with message containing \"%s\" but instead found message \"%s\"",
              ResourceConfigException.class.getSimpleName(), expectedPartialMessage, e.getMessage()));
    }
  }