@Test public void testMultiplexExceptions() { try { cut.generateKeys(null); fail("Expected exception"); } catch (InvalidParameterException ex) { } try { cut.generateKeys(new Object[0]); fail("Expected exception"); } catch (InvalidParameterException ex) { } }
@Override public String[] generateKeys(final Object[] keyObjects) { if (keyObjects == null || keyObjects.length < 1) { throw new InvalidParameterException("The key objects must be defined."); } final String[] results = new String[keyObjects.length]; for (int i = 0; i < keyObjects.length; i++) { results[i] = generateKey(keyObjects[i]); } return results; }
DefaultKeyProvider implements KeyProvider { @Override public String[] generateKeys(final Object[] keyObjects) { if (keyObjects == null || keyObjects.length < 1) { throw new InvalidParameterException("The key objects must be defined."); } final String[] results = new String[keyObjects.length]; for (int i = 0; i < keyObjects.length; i++) { results[i] = generateKey(keyObjects[i]); } return results; } }
DefaultKeyProvider implements KeyProvider { @Override public String[] generateKeys(final Object[] keyObjects) { if (keyObjects == null || keyObjects.length < 1) { throw new InvalidParameterException("The key objects must be defined."); } final String[] results = new String[keyObjects.length]; for (int i = 0; i < keyObjects.length; i++) { results[i] = generateKey(keyObjects[i]); } return results; }  }
DefaultKeyProvider implements KeyProvider { @Override public String[] generateKeys(final Object[] keyObjects) { if (keyObjects == null || keyObjects.length < 1) { throw new InvalidParameterException("The key objects must be defined."); } final String[] results = new String[keyObjects.length]; for (int i = 0; i < keyObjects.length; i++) { results[i] = generateKey(keyObjects[i]); } return results; }  void setMethodStore(final CacheKeyMethodStore methodStore); CacheKeyMethodStore getMethodStore(); @Override String generateKey(final Object keyObject); @Override String[] generateKeys(final Object[] keyObjects); }
DefaultKeyProvider implements KeyProvider { @Override public String[] generateKeys(final Object[] keyObjects) { if (keyObjects == null || keyObjects.length < 1) { throw new InvalidParameterException("The key objects must be defined."); } final String[] results = new String[keyObjects.length]; for (int i = 0; i < keyObjects.length; i++) { results[i] = generateKey(keyObjects[i]); } return results; }  void setMethodStore(final CacheKeyMethodStore methodStore); CacheKeyMethodStore getMethodStore(); @Override String generateKey(final Object keyObject); @Override String[] generateKeys(final Object[] keyObjects);  }