docs: public RandomVariableInterface barrier(RandomVariableInterface trigger, RandomVariableInterface valueIfTriggerNonNegative, RandomVariableInterface valueIfTriggerNegative) {
  		// Set time of this random variable to maximum of time with respect to which measurability is known.
  		double newTime = Math.max(time, trigger.getFiltrationTime());
  		newTime = Math.max(newTime, valueIfTriggerNonNegative.getFiltrationTime());
  		newTime = Math.max(newTime, valueIfTriggerNegative.getFiltrationTime());
  
  		if(isDeterministic() && trigger.isDeterministic() && valueIfTriggerNonNegative.isDeterministic() && valueIfTriggerNegative.isDeterministic()) {
  			double newValueIfNonStochastic = trigger.get(0) >= 0 ? valueIfTriggerNonNegative.get(0) : valueIfTriggerNegative.get(0);
  			return new RandomVariableLowMemory(newTime, newValueIfNonStochastic);
  		}
  		else {
  			int numberOfPaths = Math.max(Math.max(trigger.size(), valueIfTriggerNonNegative.size()), valueIfTriggerNegative.size());
  			double[] newRealizations = new double[numberOfPaths];
  			for(int i=0; i<newRealizations.length; i++) {
  				newRealizations[i] = trigger.get(i) >= 0.0 ? valueIfTriggerNonNegative.get(i) : valueIfTriggerNegative.get(i);
  			}
  			return new RandomVariableLowMemory(newTime, newRealizations);
  		}
  	}