// Path: config/src/main/java/io/confluent/common/config/types/Password.java
// public class Password {
// 
//     public static final String HIDDEN = "[hidden]";
// 
//     private final String value;
// 
//     /**
//      * Construct a new Password object
//      * @param value The value of a password
//      */
//     public Password(String value) {
//         this.value = value;
//     }
// 
//     @Override
//     public int hashCode() {
//         return value.hashCode();
//     }
// 
//     @Override
//     public boolean equals(Object obj) {
//         if (!(obj instanceof Password))
//             return false;
//         Password other = (Password) obj;
//         return value.equals(other.value);
//     }
// 
//     /**
//      * Returns hidden password string
//      *
//      * @return hidden password string
//      */
//     @Override
//     public String toString() {
//         return HIDDEN;
//     }
// 
//     /**
//      * Returns real password string
//      *
//      * @return real password string
//      */
//     public String value() {
//         return value;
//     }
// }
// 
// Path: config/src/main/java/io/confluent/common/config/ConfigDef.java
// public enum Type {
//   BOOLEAN, STRING, INT, LONG, DOUBLE, LIST, CLASS, PASSWORD, MAP
// }


import org.junit.Assert;
import org.junit.Test;
import java.io.IOException;
import java.net.URL;
import java.net.URLClassLoader;
import java.nio.file.Paths;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import io.confluent.common.config.types.Password;
import javax.xml.bind.DatatypeConverter;
import static io.confluent.common.config.ConfigDef.Type;
import static io.confluent.common.config.ConfigDef.Type.BOOLEAN;
import static io.confluent.common.config.ConfigDef.Type.CLASS;
import static io.confluent.common.config.ConfigDef.Type.DOUBLE;
import static io.confluent.common.config.ConfigDef.Type.INT;
import static io.confluent.common.config.ConfigDef.Type.LIST;
import static io.confluent.common.config.ConfigDef.Type.LONG;
import static io.confluent.common.config.ConfigDef.Type.STRING;
import static java.util.Arrays.asList;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.fail;
        .define("g", BOOLEAN, ConfigDef.Importance.HIGH, "docs")
        .define("h", Type.BOOLEAN, ConfigDef.Importance.HIGH, "docs")
        .define("i", Type.BOOLEAN, ConfigDef.Importance.HIGH, "docs")
        .define("j", Type.PASSWORD, ConfigDef.Importance.HIGH, "docs")
        .define("k", Type.MAP, ConfigDef.Importance.HIGH, "docs")
        .define("l", Type.MAP, ConfigDef.Importance.HIGH, "docs");

    Properties props = new Properties();
    props.put("a", "1   ");
    props.put("b", 2);
    props.put("d", " a , b, c");
    props.put("e", 42.5d);
    props.put("f", String.class.getName());
    props.put("g", "true");
    props.put("h", "FalSE");
    props.put("i", "TRUE");
    props.put("j", "password");
    props.put("k", "k1:v1,k2:v2");
    props.put("l", "k1:v1");

    Map<String, Object> vals = def.parse(props);
    assertEquals(1, vals.get("a"));
    assertEquals(2L, vals.get("b"));
    assertEquals("hello", vals.get("c"));
    assertEquals(asList("a", "b", "c"), vals.get("d"));
    assertEquals(42.5d, vals.get("e"));
    assertEquals(String.class, vals.get("f"));
    assertEquals(true, vals.get("g"));
    assertEquals(false, vals.get("h"));
    assertEquals(true, vals.get("i"));
// Path: config/src/main/java/io/confluent/common/config/types/Password.java
// public class Password {
// 
//     public static final String HIDDEN = "[hidden]";
// 
//     private final String value;
// 
//     /**
//      * Construct a new Password object
//      * @param value The value of a password
//      */
//     public Password(String value) {
//         this.value = value;
//     }
// 
//     @Override
//     public int hashCode() {
//         return value.hashCode();
//     }
// 
//     @Override
//     public boolean equals(Object obj) {
//         if (!(obj instanceof Password))
//             return false;
//         Password other = (Password) obj;
//         return value.equals(other.value);
//     }
// 
//     /**
//      * Returns hidden password string
//      *
//      * @return hidden password string
//      */
//     @Override
//     public String toString() {
//         return HIDDEN;
//     }
// 
//     /**
//      * Returns real password string
//      *
//      * @return real password string
//      */
//     public String value() {
//         return value;
//     }
// }
// 
// Path: config/src/main/java/io/confluent/common/config/ConfigDef.java
// public enum Type {
//   BOOLEAN, STRING, INT, LONG, DOUBLE, LIST, CLASS, PASSWORD, MAP
// }


// Path: config/src/test/java/io/confluent/common/config/ConfigDefTest.java
import org.junit.Assert;
import org.junit.Test;
import java.io.IOException;
import java.net.URL;
import java.net.URLClassLoader;
import java.nio.file.Paths;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import io.confluent.common.config.types.Password;
import javax.xml.bind.DatatypeConverter;
import static io.confluent.common.config.ConfigDef.Type;
import static io.confluent.common.config.ConfigDef.Type.BOOLEAN;
import static io.confluent.common.config.ConfigDef.Type.CLASS;
import static io.confluent.common.config.ConfigDef.Type.DOUBLE;
import static io.confluent.common.config.ConfigDef.Type.INT;
import static io.confluent.common.config.ConfigDef.Type.LIST;
import static io.confluent.common.config.ConfigDef.Type.LONG;
import static io.confluent.common.config.ConfigDef.Type.STRING;
import static java.util.Arrays.asList;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.fail;

        .define("g", BOOLEAN, ConfigDef.Importance.HIGH, "docs")
        .define("h", Type.BOOLEAN, ConfigDef.Importance.HIGH, "docs")
        .define("i", Type.BOOLEAN, ConfigDef.Importance.HIGH, "docs")
        .define("j", Type.PASSWORD, ConfigDef.Importance.HIGH, "docs")
        .define("k", Type.MAP, ConfigDef.Importance.HIGH, "docs")
        .define("l", Type.MAP, ConfigDef.Importance.HIGH, "docs");

    Properties props = new Properties();
    props.put("a", "1   ");
    props.put("b", 2);
    props.put("d", " a , b, c");
    props.put("e", 42.5d);
    props.put("f", String.class.getName());
    props.put("g", "true");
    props.put("h", "FalSE");
    props.put("i", "TRUE");
    props.put("j", "password");
    props.put("k", "k1:v1,k2:v2");
    props.put("l", "k1:v1");

    Map<String, Object> vals = def.parse(props);
    assertEquals(1, vals.get("a"));
    assertEquals(2L, vals.get("b"));
    assertEquals("hello", vals.get("c"));
    assertEquals(asList("a", "b", "c"), vals.get("d"));
    assertEquals(42.5d, vals.get("e"));
    assertEquals(String.class, vals.get("f"));
    assertEquals(true, vals.get("g"));
    assertEquals(false, vals.get("h"));
    assertEquals(true, vals.get("i"));
    assertEquals(new Password("password"), vals.get("j"));