title: Groovy Spock How to mock static functions from java classes
body: <p>I want to mock function like Files.copy(), LocalDate.now() from Java e.g.
  In one of my function I have</p>
  <pre><code>public int functionForTest(){
      var now = LocalDate.now()
      if(now.getMonth() == 2)
         return 55;
      if(now.getMonth() == 4)
         return 22;
  }
  </code></pre>
  <p>and based on current month I have to return some value but when I want to test this function I have to mock LocalDate.now(). Does someone know how to mock this function?</p>