title: Bean Validation Groups - Understanding it correctly
body: <p>I am trying to understand the Groups in Bean validation. </p>
  
  <p>So for instance if I have a bean and I want only certain field validated for certain cases, I should group them?</p>
  
  <pre><code> @NotNull (groups=MyClassX.class)
   @Min (groups=MyClassA.class)  // 1
   @Pattern(xxxxx, groups = MyClassA.class) // 2
   private String field1;
  
   @NotNull (groups=MyClassX.class)
   @Min (groups=MyClassX.class)
   @Pattern(xxxxx, groups=MyClassX.class))
   private String field2;
  
   @NotNull (groups=MyClassX.class)
   @Min (groups=MyClassX.class)
   @Pattern(xxxxx, groups=MyClassA.class) //3
   private String field3;
  </code></pre>
  
  <p>My understanding from the above example is, if I pass <code>MyClassA</code> to validator, then only <code>@Min</code> and <code>@Pattern</code> for <code>Field1</code> and <code>@Pattern</code> for <code>field3</code> are only validated? (marked with numbers 1,2 and 3)</p>
  
  <p>Did I understand this correctly?
  I haven't left any fields without <code>Groups</code> attribute. So no default group.</p>