package com.hubspot.jinjava.lib.exptest;

import java.util.Objects;

import com.hubspot.jinjava.interpret.JinjavaInterpreter;
import com.hubspot.jinjava.util.ForLoop;
import com.hubspot.jinjava.util.ObjectIterator;

public class ContainsAllExpTest implements ExpTest {

  @Override
  public boolean evaluate(Object var, JinjavaInterpreter interpreter, Object... args) {

    if (null == var || args.length == 0) {
      return false;
    }

    ForLoop loop = ObjectIterator.getLoop(args[0]);
    while (loop.hasNext()) {
      Object matchValue = loop.next();
      ForLoop varLoop = ObjectIterator.getLoop(var);
      boolean matches = false;
      while (varLoop.hasNext()) {
        if (Objects.equals(matchValue, args[0])) {
          matches = true;
          break;
        }
      }
      if (!matches) {
        return false;
      }
    }

    return true;
  }

  @Override
  public String getName() {
    return "containsall";
  }
}

@@ -403,16 +403,35 @@
 gth == 0
+ %7C%7C args%5B0%5D == null
 ) %7B%0A    

Add null check.