class JmsMethodArgumentsKeyGenerator implements MethodArgumentsKeyGenerator {

	/**
	 * If the message is a {@link Message} then returns the JMS message ID. Otherwise just
	 * return the first argument.
	 *
	 * @see org.springframework.retry.interceptor.MethodArgumentsKeyGenerator#getKey(Object[])
	 * @throws UnexpectedInputException if the JMS id cannot be determined from a JMS
	 * Message
	 * @throws IllegalArgumentException if the arguments are empty
	 */
	@Override
	public Object getKey(Object[] items) {<FILL_FUNCTION_BODY>}

}

		for (Object item : items) {
			if (item instanceof Message) {
				try {
					return ((Message) item).getJMSMessageID();
				}
				catch (JMSException e) {
					throw new UnexpectedInputException("Could not extract message ID", e);
				}
			}
		}
		if (items.length == 0) {
			throw new IllegalArgumentException(
					"Method parameters are empty.  The key generator cannot determine a unique key.");
		}
		return items[0];
	
<no_super_class>