code: public static void assertProcessEndedAndInExclusiveEndEvent(final String processInstanceId, final String endEventId) {
          Validate.notNull(processInstanceId);
          Validate.notNull(endEventId);
  
          apiCallback.debug(LogMessage.PROCESS_9, processInstanceId, endEventId);
          try {
              getEndEventAssertable().processEndedAndInExclusiveEndEvent(processInstanceId, endEventId);
          } catch (final AssertionError ae) {
              apiCallback.fail(ae, LogMessage.ERROR_PROCESS_3, processInstanceId, endEventId);
          }
      }
docs: Asserts the process instance with the provided id is ended and has reached <strong>only</strong> the end event
  with the provided id.
  
  <p>
  <strong>Note:</strong> this assertion should be used for processes that have exclusive end events and no
  intermediate end events. This generally only applies to simple processes. If the process definition branches into
  non-exclusive branches with distinct end events or the process potentially has multiple end events that are
  reached, this method should not be used.
  
  <p>
  To test that a process ended in an end event and that particular end event was the final event reached, use
  {@link #assertProcessEndedAndReachedEndStateLast(String, String)} instead.
  
  <p>
  To assert that a process ended in an exact set of end events, use
  {@link #assertProcessEndedAndInEndEvents(String, String...)} instead.
  
  @see #assertProcessEndedAndReachedEndStateLast(String, String)
  @see #assertProcessEndedAndInEndEvents(String, String...)
  
  @param processInstanceId
  the process instance's id to check for. May not be <code>null</code>
  @param endEventId
  the end event's id to check for. May not be <code>null</code>