### Question:
HiveDataSource extends BaseDataSource { @Override protected String filterOther(String otherParams) { if (StringUtils.isBlank(otherParams)) { return ""; } StringBuilder hiveConfListSb = new StringBuilder(); hiveConfListSb.append("?"); StringBuilder sessionVarListSb = new StringBuilder(); String[] otherArray = otherParams.split(";", -1); Set<String> hiveConfSet = Stream.of(ConfVars.values()).map(confVars -> confVars.varname) .collect(Collectors.toSet()); for (String conf : otherArray) { if (hiveConfSet.contains(conf.split("=")[0])) { hiveConfListSb.append(conf).append(";"); } else { sessionVarListSb.append(conf).append(";"); } } if (sessionVarListSb.length() > 0) { sessionVarListSb.deleteCharAt(sessionVarListSb.length() - 1); } if (hiveConfListSb.length() > 0) { hiveConfListSb.deleteCharAt(hiveConfListSb.length() - 1); } return sessionVarListSb.toString() + hiveConfListSb.toString(); }  @Override String driverClassSelector(); @Override DbType dbTypeSelector();  }### Answer:
@Test public void testfilterOther() { BaseDataSource hiveDataSource = new HiveDataSource(); String other = hiveDataSource.filterOther("charset=UTF-8"); Assert.assertEquals("charset=UTF-8", other); other = hiveDataSource.filterOther(""); Assert.assertEquals("", other); other = hiveDataSource.filterOther("hive.mapred.mode=strict"); Assert.assertEquals("?hive.mapred.mode=strict", other); other = hiveDataSource.filterOther("hive.mapred.mode=strict;charset=UTF-8"); Assert.assertEquals("charset=UTF-8?hive.mapred.mode=strict", other); other = hiveDataSource.filterOther("charset=UTF-8;hive.mapred.mode=strict;foo=bar"); Assert.assertEquals("charset=UTF-8;foo=bar?hive.mapred.mode=strict", other); other = hiveDataSource.filterOther("charset=UTF-8;foo=bar;hive.mapred.mode=strict"); Assert.assertEquals("charset=UTF-8;foo=bar?hive.mapred.mode=strict", other); other = hiveDataSource.filterOther("charset=UTF-8;foo=bar;hive.mapred.mode=strict;hive.exec.parallel=true"); Assert.assertEquals("charset=UTF-8;foo=bar?hive.mapred.mode=strict;hive.exec.parallel=true", other); }