1718192021222324252627
private KeyProvider keyProvider; @Override public void setUp() throws Exception { super.setUp(); keyProvider = new KeyProvider() { public String process(String key) { // 现实中是基于某种规则进行字符串转换, 为了简单, 我直接用hashCode return String.valueOf(key.hashCode()); }