code: public <T> T doWithGroups(final GroupAction<T> action, final Class<?>... groups) {
          pushContext(groups);
          try {
              return action.call();
          } catch (Throwable ex) {
              throw Throwables.propagate(ex);
          } finally {
              popContext();
          }
      }
docs: Defines context validation groups. Context is defined for all logic inside action callback
  (in current thread).
  Note: does not override current context groups.
  
  @param action action callback to be executed with validation groups
  @param groups validation groups to use
  @param <T>    action return type
  @return object produced by action callback