### Question:
KnoxShellTable { public List<KnoxShellTableCall> getCallHistoryList() { final List<KnoxShellTableCall> sanitizedCallHistoryList = new LinkedList<>(); KnoxShellTableCallHistory.getInstance().getCallHistory(id).forEach(call -> { final Map<Object, Class<?>> params = call.hasSensitiveData() ? Collections.singletonMap("***", String.class) : call.getParams(); sanitizedCallHistoryList.add(new KnoxShellTableCall(call.getInvokerClass(), call.getMethod(), call.isBuilderMethod(), params)); }); return sanitizedCallHistoryList; } KnoxShellTable(); KnoxShellTable title(String title); KnoxShellTable header(String header); KnoxShellTable row(); KnoxShellTable value(Comparable<? extends Object> value); KnoxShellTableCell<? extends Comparable<? extends Object>> cell(int colIndex, int rowIndex); List<Comparable<? extends Object>> values(int colIndex); List<Comparable<? extends Object>> values(String colName); double mean(String colName); double mean(int colIndex); double median(String colName); double median(int colIndex); double mode(String colName); double mode(int colIndex); double sum(String colName); double sum(int colIndex); double max(String colName); double max(int colIndex); double min(String colName); double min(int colIndex); KnoxShellTable apply(KnoxShellTableCell<? extends Comparable<? extends Object>> cell); List<String> getHeaders(); List<List<Comparable<? extends Object>>> getRows(); String getTitle(); long getId(); static KnoxShellTableBuilder builder(); List<KnoxShellTableCall> getCallHistoryList(); String getCallHistory(); String rollback(); KnoxShellTable replayAll(); KnoxShellTable replay(int step); static KnoxShellTable replay(long id, int step); KnoxShellTableFilter filter(); KnoxShellTableAggregator aggregate(); KnoxShellTable select(String cols); KnoxShellTable sort(String colName); KnoxShellTable sortNumeric(String colName); KnoxShellTable sort(String colName, SortOrder order); KnoxShellTable sort(List<Comparable<? extends Object>> col,
      SortOrder order); @Override String toString(); String toJSON(); String toJSON(boolean data); String toJSON(String path); String toJSON(boolean data, String path); String toCSV(); String toCSV(String filePath);  }### Answer:
@Test public void shouldMaskUserNameAndPasswordParametersWhenConnectingToDBUsingJDBCBuilder() throws Exception { final KnoxShellTable table = new KnoxShellTable(); saveCall(table.id, "org.apache.knox.gateway.shell.table.KnoxShellTableBuilder", "jdbc", false, Collections.emptyMap()); saveCall(table.id, "org.apache.knox.gateway.shell.table.JDBCKnoxShellTableBuilder", "driver", false, singletonMap("org.apache.derby.jdbc.EmbeddedDriver", String.class)); saveCall(table.id, "org.apache.knox.gateway.shell.table.JDBCKnoxShellTableBuilder", "username", false, singletonMap("myUserName", String.class)); saveCall(table.id, "org.apache.knox.gateway.shell.table.JDBCKnoxShellTableBuilder", "pwd", false, singletonMap("myP4ssW0rd", String.class)); saveCall(table.id, "org.apache.knox.gateway.shell.table.JDBCKnoxShellTableBuilder", "connectTo", false, singletonMap("myDBConnectionUrl", String.class)); saveCall(table.id, "org.apache.knox.gateway.shell.table.JDBCKnoxShellTableBuilder", "sql", true, singletonMap("SELECT 1 FROM DUAL", String.class)); final AtomicBoolean foundSensitiveData = new AtomicBoolean(false); table.getCallHistoryList().forEach(call -> { if (call.hasSensitiveData()) { assertEquals(1, call.getParams().size()); assertTrue(call.getParams().containsKey("***")); foundSensitiveData.set(true); } }); assertTrue(foundSensitiveData.get()); }