public static CuratorFramework createCurator(ZooKeeperCuratorConfiguration configuration) {
        CuratorFramework curator = configuration.getCuratorFramework();
        if (curator == null) {
            // Validate parameters
            ObjectHelper.notNull(configuration.getNodes(), "ZooKeeper Nodes");

            RetryPolicy retryPolicy = configuration.getRetryPolicy();
            if (retryPolicy == null) {
                retryPolicy = new ExponentialBackoffRetry(
                        (int) configuration.getReconnectBaseSleepTimeUnit().toMillis(configuration.getReconnectBaseSleepTime()),
                        configuration.getReconnectMaxRetries(),
                        (int) configuration.getReconnectMaxSleepTimeUnit().toMillis(configuration.getReconnectMaxSleepTime()));
            }

            CuratorFrameworkFactory.Builder builder = CuratorFrameworkFactory.builder()
                    .connectString(String.join(",", configuration.getNodes()))
                    .sessionTimeoutMs((int) configuration.getSessionTimeoutUnit().toMillis(configuration.getSessionTimeout()))
                    .connectionTimeoutMs(
                            (int) configuration.getConnectionTimeoutUnit().toMillis(configuration.getConnectionTimeout()))
                    .maxCloseWaitMs((int) configuration.getMaxCloseWaitUnit().toMillis(configuration.getMaxCloseWait()))
                    .retryPolicy(retryPolicy);

            Optional.ofNullable(configuration.getNamespace()).ifPresent(builder::namespace);
            Optional.ofNullable(configuration.getAuthInfoList()).ifPresent(builder::authorization);

            curator = builder.build();
        }

        return curator;
    }
@Test
    public void testCreateCuratorRetryPolicy() {
        ZooKeeperCuratorConfiguration configuration = new ZooKeeperCuratorConfiguration();

        configuration.setNodes("nodes1,node2,node3");
        configuration.setReconnectBaseSleepTime(10);
        configuration.setReconnectMaxRetries(3);
        configuration.setReconnectMaxSleepTime(50);
        configuration.setRetryPolicy(null);

        CuratorFramework curatorFramework = ZooKeeperCuratorHelper.createCurator(configuration);

        assertNotNull(curatorFramework);
        ExponentialBackoffRetry retryPolicy = (ExponentialBackoffRetry) curatorFramework.getZookeeperClient().getRetryPolicy();

        assertEquals(configuration.getReconnectBaseSleepTime(), retryPolicy.getBaseSleepTimeMs(),
                "retryPolicy.reconnectBaseSleepTime");
        assertEquals(configuration.getReconnectMaxRetries(), retryPolicy.getN(), "retryPolicy.reconnectMaxRetries");
        // retryPolicy.maxSleepMs not visible here

    }