@Override
    public void close() throws Exception {
        lock();
        try {
            fileSystemWatchServiceMap.values().forEach(context -> {
                try {
                    context.close();
                } catch (IOException e) {
                    throw new UncheckedIOException(e);
                }
            });
            fileSystemWatchServiceMap.clear();
        } finally {
            unlock();
        }
    }
Closes the {@link WatchService}, thread, and registry.
@throws Exception may be thrown if an I/O error occurs
core/src/main/java/com/linecorp/armeria/client/endpoint/FileWatcherRegistry.java