public synchronized void register(String id, MapInterceptor interceptor) {
        assert !(Thread.currentThread() instanceof PartitionOperationThread);

        if (id2InterceptorMap.containsKey(id)) {
            return;
        }

        Map<String, MapInterceptor> tmpMap = new HashMap<>(id2InterceptorMap);
        tmpMap.put(id, interceptor);

        id2InterceptorMap = unmodifiableMap(tmpMap);

        List<MapInterceptor> tmpInterceptors = new ArrayList<>(interceptors);
        tmpInterceptors.add(interceptor);

        interceptors = unmodifiableList(tmpInterceptors);
    }
@Test
    @RequireAssertEnabled
    public void testRegister_fromPartitionOperationThread() throws Exception {
        OperationQueue queue = new OperationQueueImpl();
        PartitionOperationThread thread = getPartitionOperationThread(queue);
        thread.start();

        final CountDownLatch latch = new CountDownLatch(1);
        Object task = (Runnable) () -> {
            try {
                registry.register(interceptor.id, interceptor);
            } catch (AssertionError e) {
                e.printStackTrace();
                latch.countDown();
            }
        };
        queue.add(task, false);

        latch.await();
        thread.shutdown();
        thread.join();

        assertInterceptorRegistryContainsNotInterceptor();
    }