code: public void validateAllExtensionNumbers() {
      final Map<String, Set<Integer>> extensionNumbers = new HashMap<String, Set<Integer>>(); // multiset
      Map<String, Set<Integer>> localExtensionNumbers = new HashMap<String, Set<Integer>>();
  
      for (final FieldDescriptorProtoOrBuilder extension : rootScope.protoBuilder
          .getExtensionOrBuilderList()) {
        processExtensionField(extensionNumbers, localExtensionNumbers, extension);
      }
  
      localExtensionNumbers = null;
  
      for (final DescriptorProtoOrBuilder childProto : rootScope.protoBuilder
          .getMessageTypeOrBuilderList()) {
        processAllExtensions(childProto, extensionNumbers);
      }
    }
docs: duplicates!