package com.hubspot.baragon.agent.handlebars;

import java.io.IOException;
import java.util.List;
import java.util.Objects;

import com.github.jknack.handlebars.Options;

public class IfContainedInHelperSource {

  public static CharSequence ifContainedIn(List<String> haystack, String needle, Options options) throws IOException {
    if (Objects.isNull(haystack)) {
      return options.inverse();
    }

    for (String element : haystack) {
      if (element.contains(needle)) {
        return options.fn();
      }
    }

    return options.inverse();
  }

}

@@ -85,20 +85,26 @@
 va.util.
-List
+Collection
 ;%0Aimport
@@ -259,12 +259,18 @@
 dIn(
-List
+Collection
 %3CStr

Make haystack parameter more generic.