### Question:
DefaultKeyProvider implements KeyProvider { public List<String> generateKeys(final List<Object> keyObjects) { if (keyObjects == null || keyObjects.size() < 1) { throw new InvalidParameterException("The key objects must be defined."); } final List<String> results = new ArrayList<String>(keyObjects.size()); for (final Object keyObject : keyObjects) { results.add(generateKey(keyObject)); } return results; }  void setMethodStore(CacheKeyMethodStore methodStore); String generateKey(final Object keyObject); List<String> generateKeys(final List<Object> keyObjects);  }### Answer:
@Test public void testMultiplexExceptions() { try { cut.generateKeys(null); fail("Expected exception"); } catch (InvalidParameterException ex) { } try { cut.generateKeys(new ArrayList<Object>()); fail("Expected exception"); } catch (InvalidParameterException ex) { } }
@Test public void testMultiplex() { final List<Object> src = new ArrayList<Object>(); final List<String> expectedResults = new ArrayList<String>(); final String data = "abcdefghijklmnopqrstuvwxyz"; for (int ix = 0; ix < 4; ix++) { final String val = data.substring(0, 5 + ix); src.add(new KeyObject(val)); expectedResults.add(val); } final List<String> results = cut.generateKeys(src); assertEquals(expectedResults, results); }