### Question:
MethodSignatureKeyGenerator implements KeyGenerator { @Override public String generate(Object target, Method method, Object... params) { String key = target.getClass().getSimpleName() + ":" + method.getName() + ":"; key += generateParamsKeyPart(params); return key; }  @Override String generate(Object target, Method method, Object... params);  }### Answer:
@Test public void generateKey_NO_ARG_METHOD() throws NoSuchMethodException, SecurityException { String target = "XYZ"; Method method = String.class.getMethod("toString"); String key = keyGenerator.generate(target, method); assertEquals("String:toString:", key); }
@Test public void generateKey_ARG_METHOD() throws NoSuchMethodException, SecurityException { String target = "XYZ"; Method method = String.class.getMethod("toString"); Object[] params = new Object[]{30, new Param(), null, new String[]{"aa","bb"}}; String key = keyGenerator.generate(target, method, params); assertEquals("String:toString: arg1:30 arg2:100$==300pln arg3:null arg4:{aa,bb}", key); }