public static Optional<File> getPluginsDir() {
        String pluginsDir =
                System.getenv()
                        .getOrDefault(
                                ConfigConstants.ENV_FLINK_PLUGINS_DIR,
                                ConfigConstants.DEFAULT_FLINK_PLUGINS_DIRS);

        File pluginsDirFile = new File(pluginsDir);
        if (!pluginsDirFile.isDirectory()) {
            LOG.warn("The plugins directory [{}] does not exist.", pluginsDirFile);
            return Optional.empty();
        }
        return Optional.of(pluginsDirFile);
    }
@Test
    void getPluginsDir_existingDirectory_returnsDirectoryFile() throws IOException {
        final File pluginsDirectory = TempDirUtils.newFolder(tempFolder);
        final Map<String, String> envVariables =
                ImmutableMap.of(
                        ConfigConstants.ENV_FLINK_PLUGINS_DIR, pluginsDirectory.getAbsolutePath());
        CommonTestUtils.setEnv(envVariables);

        assertThat(PluginConfig.getPluginsDir()).contains(pluginsDirectory);
    }