private static ClassHierarchyProto.Node newClassNode(
     String name,
     String fullName,
     boolean isInjectionCandidate,
     boolean isExternalConstructor,
     boolean isUnit,
     List<ClassHierarchyProto.ConstructorDef> injectableConstructors,
     List<ClassHierarchyProto.ConstructorDef> otherConstructors,
     List<String> implFullNames,
     Iterable<ClassHierarchyProto.Node> children) {
   return ClassHierarchyProto.Node.newBuilder()
       .setName(name)
       .setFullName(fullName)
       .setClassNode(
           ClassHierarchyProto.ClassNode.newBuilder()
               .setIsInjectionCandidate(isInjectionCandidate)
               .setIsExternalConstructor(isExternalConstructor)
               .setIsUnit(isUnit)
               .addAllInjectableConstructors(injectableConstructors)
               .addAllOtherConstructors(otherConstructors)
               .addAllImplFullNames(implFullNames)
               .build())
       .addAllChildren(children)
       .build();
 }
  private static ClassHierarchyProto.Node newNamedParameterNode(
      String name,
      String fullName,
      String simpleArgClassName,
      String fullArgClassName,
      boolean isSet,
      boolean isList,
      String documentation, // can be null
      String shortName, // can be null
      String[] instanceDefault, // can be null
      Iterable<ClassHierarchyProto.Node> children) {
    ClassHierarchyProto.NamedParameterNode.Builder namedParameterNodeBuilder =
        ClassHierarchyProto.NamedParameterNode.newBuilder()
            .setSimpleArgClassName(simpleArgClassName)
            .setFullArgClassName(fullArgClassName)
            .setIsSet(isSet)
            .setIsList(isList);
    if (documentation != null) {
      namedParameterNodeBuilder.setDocumentation(documentation);
    }
    if (shortName != null) {
      namedParameterNodeBuilder.setShortName(shortName);
    }
    if (instanceDefault != null) {
      namedParameterNodeBuilder.addAllInstanceDefault(Arrays.asList(instanceDefault));
    }

    return ClassHierarchyProto.Node.newBuilder()
        .setName(name)
        .setFullName(fullName)
        .setNamedParameterNode(namedParameterNodeBuilder.build())
        .addAllChildren(children)
        .build();
  }
 private static ClassHierarchyProto.Node newPackageNode(
     String name, String fullName, Iterable<ClassHierarchyProto.Node> children) {
   return ClassHierarchyProto.Node.newBuilder()
       .setPackageNode(ClassHierarchyProto.PackageNode.newBuilder().build())
       .setName(name)
       .setFullName(fullName)
       .addAllChildren(children)
       .build();
 }