code: private void synchronizedRecordResult(CircuitBreakerResult result) {
          synchronized (this) {
              switch (state.get()) {
                  case CLOSED:
                      rollingWindow.record(result);
                      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                          Tr.debug(tc, "Recording result {0} in closed state: {1}", result, rollingWindow);
                      }
                      if (rollingWindow.isOverThreshold()) {
                          stateOpen();
                      }
                      break;
                  case HALF_OPEN:
                      if (result == CircuitBreakerResult.FAILURE) {
                          stateOpen();
                      } else {
                          halfOpenRunningExecutions--;
                          halfOpenSuccessfulExecutions++;
                          if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                              Tr.debug(tc, "Recording result {0} in half-open state. Running executions: {1}, Current results: ({2}/{3})",
                                       result, halfOpenRunningExecutions, halfOpenSuccessfulExecutions, policy.getSuccessThreshold());
                          }
                          if (halfOpenSuccessfulExecutions >= policy.getSuccessThreshold()) {
                              stateClosed();
                          }
                      }
                      break;
                  case OPEN:
                      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                          Tr.debug(tc, "Recording result {0} in open state", result);
                      }
                      // Nothing else to do
                      break;
              }
          }
      }
docs: Implements the logic for recordResult for the cases where synchronization is required