ApplicationConfig extends AbstractConfig { public void setQosAcceptForeignIp(Boolean qosAcceptForeignIp) { this.qosAcceptForeignIp = qosAcceptForeignIp; } ApplicationConfig();  ApplicationConfig(String name); @Parameter(key = Constants.APPLICATION_KEY, required = true) String getName(); void setName(String name); @Parameter(key = "application.version") String getVersion(); void setVersion(String version); String getOwner(); void setOwner(String owner); String getOrganization(); void setOrganization(String organization); String getArchitecture(); void setArchitecture(String architecture); String getEnvironment(); void setEnvironment(String environment); RegistryConfig getRegistry(); void setRegistry(RegistryConfig registry); List<RegistryConfig> getRegistries(); @SuppressWarnings({"unchecked"}) void setRegistries(List<? extends RegistryConfig> registries); MonitorConfig getMonitor(); void setMonitor(MonitorConfig monitor); void setMonitor(String monitor); String getCompiler(); void setCompiler(String compiler); String getLogger(); void setLogger(String logger); Boolean isDefault(); void setDefault(Boolean isDefault); @Parameter(key = Constants.DUMP_DIRECTORY) String getDumpDirectory(); void setDumpDirectory(String dumpDirectory); @Parameter(key = Constants.QOS_ENABLE) Boolean getQosEnable(); void setQosEnable(Boolean qosEnable); @Parameter(key = Constants.QOS_PORT) Integer getQosPort(); void setQosPort(Integer qosPort); @Parameter(key = Constants.ACCEPT_FOREIGN_IP) Boolean getQosAcceptForeignIp(); void setQosAcceptForeignIp(Boolean qosAcceptForeignIp); Map<String, String> getParameters(); void setParameters(Map<String, String> parameters);  }
@Test public void testParameters() throws Exception { ApplicationConfig application = new ApplicationConfig("app"); application.setQosAcceptForeignIp(true); Map<String, String> parameters = new HashMap<String, String>(); parameters.put("k1", "v1"); ApplicationConfig.appendParameters(parameters, application); assertThat(parameters, hasEntry("k1", "v1")); assertThat(parameters, hasEntry(Constants.ACCEPT_FOREIGN_IP, "true")); }