title: Cannot use immutable DTO in Spock test
body: <p>I have immutable DTO</p>
  
  <pre><code>@Value
  @Builder
  public class UserDto {
  
      Long id;
      String username;
  }
  </code></pre>
  
  <p><code>@Value</code> annotations comes from <a href="https://projectlombok.org/features/Value" rel="nofollow noreferrer">project lombok</a>.
  It marks all fields as <code>private</code> and <code>final</code>. Moreover class is also marked as <code>final</code> and <code>equals()</code> <code>hashCode()</code> and <code>toString()</code> methods are generated. I found it very convenient when implementing <em>data transfer objects</em></p>
  
  <p>The problem begun while writing test using <a href="http://spockframework.org" rel="nofollow noreferrer">spock framework</a>. 
  When inside the test I try to mock some behaviour:</p>
  
  <pre><code>userFactory.create(userDto) &gt;&gt; user
  </code></pre>
  
  <p>exception is thrown: </p>
  
  <pre><code>org.spockframework.mock.CannotCreateMockException: Cannot create mock for class user.dto.UserDto because Java mocks cannot mock final classes.
  </code></pre>
  
  <p>Is there any solution to these in <code>Spock</code> framework or in any other way? I'm really sticked to <code>@Value</code> annotation and I don't want to remove it.</p>