class PrependSensorReceiverStrategy implements IResolveDependencyStrategy {

    @Override
    public <T> T resolve(final Object... args) throws ResolveDependencyStrategyException {
        final IMessageReceiver originalReceiver = (IMessageReceiver) args[0];
        final IMessageReceiver sensorReceiver = (IMessageReceiver) args[1];

        if (originalReceiver == null) {
            return (T) sensorReceiver;
        }

        return (T) new CompositeSensorReceiver(sensorReceiver, originalReceiver);
    }

}