@Test
public void testGenerateCacheKey() throws Exception {

    final Method method = KeyObject.class.getMethod("toString", (Class<?>[]) null);
    try {
        cut.generateObjectId(method, new KeyObject(null));
        fail("Expected Exception.");
    } catch (RuntimeException ex) {
        assertTrue(ex.getMessage().indexOf("empty key value") != -1);
    }
    try {
        cut.generateObjectId(method, new KeyObject(""));
        fail("Expected Exception.");
    } catch (RuntimeException ex) {
        assertTrue(ex.getMessage().indexOf("empty key value") != -1);
    }
    final String result = "momma";
    assertEquals(result, cut.generateObjectId(method, new KeyObject(result)));
}