private static void userCodeDeployment(XmlGenerator gen, ClientUserCodeDeploymentConfig userCodeDeployment) {
        gen.open("user-code-deployment", "enabled", userCodeDeployment.isEnabled());
        List<String> classNames = userCodeDeployment.getClassNames();
        if (!classNames.isEmpty()) {
            gen.open("classNames");
            for (String className : classNames) {
                gen.node("className", className);
            }
            //close classNames
            gen.close();
        }
        List<String> jarPaths = userCodeDeployment.getJarPaths();
        if (!jarPaths.isEmpty()) {
            gen.open("jarPaths");
            for (String jarPath : jarPaths) {
                gen.node("jarPath", jarPath);
            }
            //close jarPaths
            gen.close();
        }

        //close user-code-deployment
        gen.close();
    }
@Test
    public void userCodeDeployment() {
        ClientUserCodeDeploymentConfig expected = new ClientUserCodeDeploymentConfig();
        expected.setEnabled(true)
                .addClass(randomString())
                .addJar(randomString());
        clientConfig.setUserCodeDeploymentConfig(expected);

        ClientUserCodeDeploymentConfig actual = newConfigViaGenerator().getUserCodeDeploymentConfig();
        assertEquals(expected.isEnabled(), actual.isEnabled());
        assertCollection(expected.getClassNames(), actual.getClassNames());
        assertCollection(expected.getJarPaths(), actual.getJarPaths());
    }