code: public static boolean evaluateTrigger(Trigger trigger, Double actualValue) {
          requireArgument(trigger != null, "Trigger cannot be null.");
          requireArgument(actualValue != null, "Trigger cannot be evaulated against null.");
  
          Double lowThreshold, highThreshold;
  
          switch (trigger.type) {
              case GREATER_THAN:
                  return actualValue.compareTo(trigger.getThreshold()) > 0;
              case GREATER_THAN_OR_EQ:
                  return actualValue.compareTo(trigger.getThreshold()) >= 0;
              case LESS_THAN:
                  return actualValue.compareTo(trigger.getThreshold()) < 0;
              case LESS_THAN_OR_EQ:
                  return actualValue.compareTo(trigger.getThreshold()) <= 0;
              case EQUAL:
                  return actualValue.compareTo(trigger.getThreshold()) == 0;
              case NOT_EQUAL:
                  return actualValue.compareTo(trigger.getThreshold()) != 0;
              case BETWEEN:
                  lowThreshold = Math.min(trigger.getThreshold(), trigger.getSecondaryThreshold());
                  highThreshold = Math.max(trigger.getThreshold(), trigger.getSecondaryThreshold());
                  return (actualValue.compareTo(lowThreshold) >= 0 && actualValue.compareTo(highThreshold) <= 0);
              case NOT_BETWEEN:
                  lowThreshold = Math.min(trigger.getThreshold(), trigger.getSecondaryThreshold());
                  highThreshold = Math.max(trigger.getThreshold(), trigger.getSecondaryThreshold());
                  return (actualValue.compareTo(lowThreshold) < 0 || actualValue.compareTo(highThreshold) > 0);
              case NO_DATA:
              	    return actualValue == null;
              default:
                  throw new SystemException("Unsupported trigger type " + trigger.type);
          }
      }
docs: Evaluates the trigger against actualValue (passed as parameter).
  
  @param   trigger      trigger to be evaluated.
  @param   actualValue  value against the trigger to be evaluated.
  
  @return  true if the trigger should be fired so that notification will be sent otherwise false.
  
  @throws  SystemException  If an error in evaluation occurs.