@VisibleForTesting
  public static UClassIdent create(String qualifiedName) {
    List<String> topLevelPath = new ArrayList<>();
    for (String component : Splitter.on('.').split(qualifiedName)) {
      topLevelPath.add(component);
      if (Character.isUpperCase(component.charAt(0))) {
        break;
      }
    }
    return create(Joiner.on('.').join(topLevelPath), qualifiedName);
  }
@Test
  public void importConflicts() {
    ImportPolicy.bind(context, ImportPolicy.IMPORT_TOP_LEVEL);
    context.put(PackageSymbol.class, Symtab.instance(context).rootPackage);
    // Test fully qualified class names
    inliner.addImport("package.Exception");
    assertInlines("Exception", UClassIdent.create("package.Exception"));
    // Will import "anotherPackage.Exception" due to conflicts
    assertInlines("anotherPackage.Exception", UClassIdent.create("anotherPackage.Exception"));
    new EqualsTester()
        .addEqualityGroup(inliner.getImportsToAdd(), ImmutableSet.of("package.Exception"))
        .testEquals();
    // Test nested class names
    inliner.addImport("package.subpackage.Foo.Bar");
    // Will import "package.Foo"
    assertInlines("Foo.Bar", UClassIdent.create("package.Foo.Bar"));
    assertInlines("Bar", UClassIdent.create("package.subpackage.Foo.Bar"));
    // Will not import "anotherPackage.Foo" due to conflicts
    assertInlines("anotherPackage.Foo.Bar", UClassIdent.create("anotherPackage.Foo.Bar"));
    new EqualsTester()
        .addEqualityGroup(
            inliner.getImportsToAdd(),
            ImmutableSet.of("package.Exception", "package.subpackage.Foo.Bar", "package.Foo"))
        .testEquals();
  }