@Test
  public void swaggerConflictingNestedApisWithSamePreferredParent() {
    AmbariSwaggerReader asr = new AmbariSwaggerReader(null, createMock(Log.class));
    Set<Class<?>> classes = new LinkedHashSet<>(Arrays.asList(TopLevelAPI.class, AnotherTopLevelAPI.class,
            NestedWithSamePreferredParentAPI.class));
    Swagger swagger = asr.read(classes);
    assertEquals(
            ImmutableSet.of("/toplevel/top", "/toplevel/{param}/nestedWithSamePreferredParent/list",
                    "/toplevel2/anotherTop"),
            swagger.getPaths().keySet());
    assertPathParamsExist(swagger, "/toplevel/{param}/nestedWithSamePreferredParent/list", "param");
  }
Test conflicting nested API's (the same API's are returned from different top level API's) with
{@link SwaggerPreferredParent} annotation.
In this case the preferred parent API is the same as the one otherwise would have been set.
ambari-utility/src/test/java/org/apache/ambari/swagger/AmbariSwaggerReaderTest.java