class TradeProcessor implements ItemProcessor<Trade, Trade> {

	private int failure = -1;

	private int index = 0;

	private Trade failedItem = null;

	/**
	 * Public setter for the index on which failure should occur.
	 * @param failure the failure to set
	 */
	public void setValidationFailure(int failure) {
		this.failure = failure;
	}

	@Nullable
	@Override
	public Trade process(Trade item) throws Exception {<FILL_FUNCTION_BODY>}

}

		if ((failedItem == null && index++ == failure) || (failedItem != null && failedItem.equals(item))) {
			failedItem = item;
			throw new ValidationException("Some bad data for " + failedItem);
		}
		return item;
	
<no_super_class>