### Question:
DefaultKeyProvider implements KeyProvider { public String generateKey(final Object keyObject) { if (keyObject == null) { throw new InvalidParameterException("keyObject must be defined"); } try { final Method keyMethod = getKeyMethod(keyObject); return generateObjectId(keyMethod, keyObject); } catch (Exception ex) { throw new RuntimeException(ex); } }  void setMethodStore(CacheKeyMethodStore methodStore); String generateKey(final Object keyObject); List<String> generateKeys(final List<Object> keyObjects);  }### Answer:
@Test public void testGenerateExceptions() { try { cut.generateKey(null); fail("Expected exception"); } catch (InvalidParameterException ex) { } }