code: Field dereference(Field self, String field) {
      if (field.startsWith("[") && field.endsWith("]")) {
        field = field.substring(1, field.length() - 1);
      }
  
      Type type = protoTypeNames.get(self.type().toString());
      if (type instanceof MessageType) {
        MessageType messageType = (MessageType) type;
        Field messageField = messageType.field(field);
        if (messageField != null) return messageField;
  
        Map<String, Field> typeExtensions = messageType.extensionFieldsMap();
        Field extensionField = resolve(field, typeExtensions);
        if (extensionField != null) return extensionField;
      }
  
      return null; // Unable to traverse this field path.
    }
docs: Returns the field named {@code field} on the message type of {@code self}.