public PatternResolveState invert() {
    switch (this) {
      case WHEN_TRUE:
        return WHEN_FALSE;
      case WHEN_FALSE:
        return WHEN_TRUE;
      default:
        return this;
    }
  }
public PatternResolveState invert()