@Override
	protected void process(WorkUnit work) {
		if (!work.getData().isEmpty()) {
			mData.add(work);
		}
		
		if (work.isLast()) {
			Collections.sort(mData);
			
			// Write each work unit to the output.
			for (WorkUnit workUnit : mData) {
				try {
					getOutputPort().write(workUnit);
					mLogger.finest("Wrote WorkUnit: " + workUnit.getData());
				} catch (InterruptedException e) {
					return;
				}	
			}
			
			try {
				WorkUnit lastWorkUnit = new WorkUnit();
				lastWorkUnit.setLast(true);
				getOutputPort().write(lastWorkUnit);
			} catch (InterruptedException e) {
				return;
			}
			
			mData.clear();
		}
	}