title: Final String with variable part
body: <p>I have a Set with some values. I want to write IN clause of a query using these values. Here is my code -</p>
  <pre><code>Class A {
        private static final Set&lt;String&gt; values = Stream.of(&quot;NY&quot;, &quot;NJ&quot;).collect(Collectors.toCollection(HashSet::new));
  
        public static set&lt;String&gt; getValues() { return  values;}
  }
  </code></pre>
  <p>I want to create the query -
  SELECT NAME FROM TABLE WHERE STATE IN ('NY', 'NJ');</p>
  <p>Following code works -</p>
  <pre><code>Class B {
       public static final String query = &quot;SELECT NAME FROM TABLE WHERE STATE IN ('NY', 'NJ')&quot;;
  }
  </code></pre>
  <p>Follwing code is one on my local while it is failing on jenkins with the error -<br />
  The system is out of resources.
  java.lang.StackOverflowError
  at com.sun.tools.javac.comp.Attr.lambdaEnv(Attr.java:2639)</p>
  <pre><code>Class B {
       public static final String query = &quot;SELECT NAME FROM TABLE WHERE STATE IN &quot; + A.getValues().stream().map(key-&gt;&quot;'&quot; + key + &quot;'&quot;).collect(Collectors.joining(&quot;,&quot;,&quot;(&quot;,&quot;)&quot;)) ;
  }
  </code></pre>
  <p>I'm guessing this doesn't have anything to do with the keyword &quot;final&quot; since it's working on my local. Can someone please help me with what's causing this error on jenkins.</p>