private static String getResourcePath(String rawPath)
  {
    if (rawPath.charAt(0) == '/')
    {
      return rawPath.substring(1);
    }
    return rawPath;
  }
@Test
  public void testSimpleResource() throws Exception
  {
    String idl = moduleDir + FS + IDLS_DIR + FS + "testSimple.restspec.json";
    Set<BuilderSpec> builderSpecs = generateBuilderSpec(new String[] {idl});
    Assert.assertNotNull(builderSpecs);
    Assert.assertTrue(builderSpecs.size() == 6);
    Map<String, String> methodMap = new HashMap<>();
    methodMap.put("get", "Gets the greeting.");
    methodMap.put("delete","Deletes the greeting.");
    methodMap.put("update", "Updates the greeting.");
    for (BuilderSpec spec : builderSpecs)
    {
      Assert.assertTrue(spec instanceof RootBuilderSpec || spec instanceof RestMethodBuilderSpec);
      if (spec instanceof RootBuilderSpec)
      {
        Assert.assertTrue(spec instanceof SimpleRootBuilderSpec);
        SimpleRootBuilderSpec simpleSpec = (SimpleRootBuilderSpec) spec;
        if (simpleSpec.getResourcePath().indexOf('/') >= 0)
        {
          Assert.assertEquals(simpleSpec.getSourceIdlName(), idl);
          Assert.assertEquals(simpleSpec.getResourcePath(), "testSimple/testSimpleSub");
          Assert.assertNotNull(simpleSpec.getRestMethods());
          Assert.assertTrue(simpleSpec.getRestMethods().size() == 1);
          Assert.assertEquals("get", simpleSpec.getRestMethods().get(0).getName());
          Assert.assertTrue(simpleSpec.getResourceActions().isEmpty());
          Assert.assertTrue(simpleSpec.getSubresources().isEmpty());
        }
        else
        {
          Assert.assertTrue(simpleSpec.getResourceActions().isEmpty());
          Assert.assertTrue(simpleSpec.getSubresources().size() == 1);
          Assert.assertEquals(simpleSpec.getSourceIdlName(), idl);
          Assert.assertEquals(simpleSpec.getResourcePath(), "testSimple");
          Assert.assertNotNull(simpleSpec.getRestMethods());
          Assert.assertTrue(simpleSpec.getRestMethods().size() == 3);
          List<RootBuilderMethodSpec> restMethods = simpleSpec.getRestMethods();
          for (RootBuilderMethodSpec method : restMethods)
          {
            Assert.assertTrue(method.getReturn() instanceof RestMethodBuilderSpec);
            Assert.assertEquals(method.getReturn().getRootBuilderMethod(), method);
            Assert.assertTrue(methodMap.containsKey(method.getName()));
            Assert.assertEquals(methodMap.get(method.getName()), method.getDoc());
          }
        }
      }
      else if (spec instanceof RestMethodBuilderSpec)
      {
        RestMethodBuilderSpec builderSpec = (RestMethodBuilderSpec) spec;
        ResourceMethod method = builderSpec.getResourceMethod();
        Assert.assertTrue(methodMap.containsKey(method.toString()));
        Assert.assertFalse(builderSpec.hasBindingMethods());
      }
    }
  }