code: public static UsageIndex build(Collection<Proto> protos) {
          UsageIndex usageIndex = new UsageIndex();
          for (Proto proto : protos) {
              ProtoWalker.newInstance(proto.getContext())
                      .onMessage(message -> {
                          for (Field field : message.getFields()) {
                              usageIndex.register(field.getType(), message);
                          }
                      })
                      .onService(service -> {
                          for (ServiceMethod serviceMethod : service.getMethods()) {
                              usageIndex.register(serviceMethod.getArgType(), service);
                              usageIndex.register(serviceMethod.getReturnType(), service);
                          }
                      })
                      .walk();
          }
          return usageIndex;
      }
docs: Build usage index for given collection of proto files.