public static void checkInstanceIsEphemeral(Instance instance) throws NacosException {
        if (!instance.isEphemeral()) {
            throw new NacosApiException(NacosException.INVALID_PARAM, ErrorCode.INSTANCE_ERROR,
                    String.format("Batch registration does not allow persistent instance registration , Instance：%s", instance));
        }
    }
@Test
    void testCheckInstanceIsEphemeral() throws NacosException {
        Instance instance = new Instance();
        instance.setIp("127.0.0.1");
        instance.setPort(9089);
        instance.setEphemeral(true);
        NamingUtils.checkInstanceIsEphemeral(instance);
        try {
            instance = new Instance();
            instance.setIp("127.0.0.1");
            instance.setPort(9089);
            instance.setEphemeral(false);
            NamingUtils.checkInstanceIsEphemeral(instance);
        } catch (NacosException e) {
            assertEquals(NacosException.INVALID_PARAM, e.getErrCode());
        }
    }