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
  public void testPathKeyParamAnnotations()
  {
    // Test correct use of both @PathKeyParam and @PathKeysParam
    final Map<String, ResourceModel> resourceModels = new HashMap<>();
    try
    {
      resourceModels.putAll(RestLiApiBuilder.buildResourceModels(Collections.singleton(SampleResources.PathKeyParamAnnotationsResource.class)));
    }
    catch (Exception exception)
    {
      Assert.fail(String.format("Unexpected exception: class: %s, message: \"%s\"",
          SampleResources.PathKeyParamAnnotationsResource.class.getSimpleName(), exception.getMessage()));
    }
    Assert.assertEquals(1, resourceModels.size());
    Assert.assertTrue(resourceModels.containsKey("/pathKeyParamAnnotations"));

    // Test incorrect usage of @PathKeyParam (unrecognized path key name)
    try
    {
      RestLiApiBuilder.buildResourceModels(Collections.singleton(SampleResources.BadPathKeyParamAnnotationsResource.class));
      Assert.fail("Expected a ResourceConfigException due to unrecognized path key names.");
    }
    catch (Exception exception)
    {
      Assert.assertTrue(exception instanceof ResourceConfigException);
      Assert.assertEquals("Parameter unknownId not found in path keys of class class "
          + "com.linkedin.restli.internal.server.model.SampleResources$BadPathKeyParamAnnotationsResource",
          exception.getMessage());
    }
  }