@Override
    public void notifyGroup(final Map<String, ConfigChangeEvent> groupItems) {
        groupItems.forEach((groupItemName, event) -> {
            if (EventType.DELETE.equals(event.getEventType())) {
                this.openapiDefs.remove(groupItemName);
                log.info("EndpointNameGroupingRule4OpenapiWatcher removed groupItem: {}", groupItemName);
            } else {
                this.openapiDefs.put(groupItemName, event.getNewValue());
                log.info("EndpointNameGroupingRule4OpenapiWatcher modified groupItem: {}", groupItemName);
            }
        });
        this.grouping.setEndpointGroupingRule4Openapi(new EndpointGroupingRuleReader4Openapi(openapiDefs).read());
    }
@Test
    public void testWatcher() throws FileNotFoundException {
        EndpointNameGrouping endpointNameGrouping = new EndpointNameGrouping();

        EndpointNameGroupingRule4OpenapiWatcher watcher = new EndpointNameGroupingRule4OpenapiWatcher(
            new ModuleProvider() {
                @Override
                public String name() {
                    return "test";
                }

                @Override
                public Class<? extends ModuleDefine> module() {
                    return CoreModule.class;
                }

                @Override
                public ConfigCreator newConfigCreator() {
                    return null;
                }

                @Override
                public void prepare() throws ServiceNotProvidedException {

                }

                @Override
                public void start() throws ServiceNotProvidedException {

                }

                @Override
                public void notifyAfterCompleted() throws ServiceNotProvidedException {

                }

                @Override
                public String[] requiredModules() {
                    return new String[0];
                }
            }, endpointNameGrouping);
        Assertions.assertEquals("GET:/products/{id}", endpointNameGrouping.format("serviceA", "GET:/products/123")._1());

        Map<String, ConfigChangeWatcher.ConfigChangeEvent> groupItems = new HashMap<>();
        groupItems.put(
            "serviceA.productAPI-v1",
            new ConfigChangeWatcher
                .ConfigChangeEvent(
                "openapi: 3.0.0\n" +
                    "\n" +
                    "info:\n" +
                    "  description: OpenAPI definition for SkyWalking test.\n" +
                    "  version: v1\n" +
                    "  title: Product API\n" +
                    "\n" +
                    "tags:\n" +
                    "  - name: product\n" +
                    "    description: product\n" +
                    "  - name: relatedProducts\n" +
                    "    description: Related Products\n" +
                    "\n" +
                    "paths:\n" +
                    "  /products:\n" +
                    "    get:\n" +
                    "      tags:\n" +
                    "        - product\n" +
                    "      summary: Get all products list\n" +
                    "      description: Get all products list.\n" +
                    "      operationId: getProducts\n" +
                    "      responses:\n" +
                    "        \"200\":\n" +
                    "          description: Success\n" +
                    "          content:\n" +
                    "            application/json:\n" +
                    "              schema:\n" +
                    "                type: array\n" +
                    "                items:\n" +
                    "                  $ref: \"#/components/schemas/Product\"\n" +
                    "  /products/{order-id}:\n" + //modified from /products/{id}
                    "    get:\n" +
                    "      tags:\n" +
                    "        - product\n" +
                    "      summary: Get product details\n" +
                    "      description: Get product details with the given id.\n" +
                    "      operationId: getProduct\n" +
                    "      parameters:\n" +
                    "        - name: id\n" +
                    "          in: path\n" +
                    "          description: Product id\n" +
                    "          required: true\n" +
                    "          schema:\n" +
                    "            type: integer\n" +
                    "            format: int64\n" +
                    "      responses:\n" +
                    "        \"200\":\n" +
                    "          description: successful operation\n" +
                    "          content:\n" +
                    "            application/json:\n" +
                    "              schema:\n" +
                    "                $ref: \"#/components/schemas/ProductDetails\"\n" +
                    "        \"400\":\n" +
                    "          description: Invalid product id\n" +
                    "    post:\n" +
                    "      tags:\n" +
                    "        - product\n" +
                    "      summary: Update product details\n" +
                    "      description: Update product details with the given id.\n" +
                    "      operationId: updateProduct\n" +
                    "      parameters:\n" +
                    "        - name: id\n" +
                    "          in: path\n" +
                    "          description: Product id\n" +
                    "          required: true\n" +
                    "          schema:\n" +
                    "            type: integer\n" +
                    "            format: int64\n" +
                    "        - name: name\n" +
                    "          in: query\n" +
                    "          description: Product name\n" +
                    "          required: true\n" +
                    "          schema:\n" +
                    "            type: string\n" +
                    "      responses:\n" +
                    "        \"200\":\n" +
                    "          description: successful operation\n" +
                    "    delete:\n" +
                    "      tags:\n" +
                    "        - product\n" +
                    "      summary: Delete product details\n" +
                    "      description: Delete product details with the given id.\n" +
                    "      operationId: deleteProduct\n" +
                    "      parameters:\n" +
                    "        - name: id\n" +
                    "          in: path\n" +
                    "          description: Product id\n" +
                    "          required: true\n" +
                    "          schema:\n" +
                    "            type: integer\n" +
                    "            format: int64\n" +
                    "      responses:\n" +
                    "        \"200\":\n" +
                    "          description: successful operation\n" +
                    "  /products/{id}/relatedProducts:\n" +
                    "    get:\n" +
                    "      tags:\n" +
                    "        - relatedProducts\n" +
                    "      summary: Get related products\n" +
                    "      description: Get related products with the given product id.\n" +
                    "      operationId: getRelatedProducts\n" +
                    "      parameters:\n" +
                    "        - name: id\n" +
                    "          in: path\n" +
                    "          description: Product id\n" +
                    "          required: true\n" +
                    "          schema:\n" +
                    "            type: integer\n" +
                    "            format: int64\n" +
                    "      responses:\n" +
                    "        \"200\":\n" +
                    "          description: successful operation\n" +
                    "          content:\n" +
                    "            application/json:\n" +
                    "              schema:\n" +
                    "                $ref: \"#/components/schemas/RelatedProducts\"\n" +
                    "        \"400\":\n" +
                    "          description: Invalid product id\n" +
                    "\n" +
                    "components:\n" +
                    "  schemas:\n" +
                    "    Product:\n" +
                    "      type: object\n" +
                    "      description: Product id and name\n" +
                    "      properties:\n" +
                    "        id:\n" +
                    "          type: integer\n" +
                    "          format: int64\n" +
                    "          description: Product id\n" +
                    "        name:\n" +
                    "          type: string\n" +
                    "          description: Product name\n" +
                    "      required:\n" +
                    "        - id\n" +
                    "        - name\n" +
                    "    ProductDetails:\n" +
                    "      type: object\n" +
                    "      description: Product details\n" +
                    "      properties:\n" +
                    "        id:\n" +
                    "          type: integer\n" +
                    "          format: int64\n" +
                    "          description: Product id\n" +
                    "        name:\n" +
                    "          type: string\n" +
                    "          description: Product name\n" +
                    "        description:\n" +
                    "          type: string\n" +
                    "          description: Product description\n" +
                    "      required:\n" +
                    "        - id\n" +
                    "        - name\n" +
                    "    RelatedProducts:\n" +
                    "      type: object\n" +
                    "      description: Related Products\n" +
                    "      properties:\n" +
                    "        id:\n" +
                    "          type: integer\n" +
                    "          format: int32\n" +
                    "          description: Product id\n" +
                    "        relatedProducts:\n" +
                    "          type: array\n" +
                    "          description: List of related products\n" +
                    "          items:\n" +
                    "            $ref: \"#/components/schemas/Product\"",
                ConfigChangeWatcher.EventType.MODIFY
            )
        );

        watcher.notifyGroup(groupItems);
        Assertions.assertEquals("GET:/products/{order-id}", endpointNameGrouping.format("serviceA", "GET:/products/123")._1());

        groupItems.put("serviceA.productAPI-v1", new ConfigChangeWatcher.ConfigChangeEvent("", ConfigChangeWatcher.EventType.DELETE));
        watcher.notifyGroup(groupItems);

        Assertions.assertEquals("GET:/products/123", endpointNameGrouping.format("serviceA", "GET:/products/123")._1());

    }