class FlowExecutionStatus implements Comparable<FlowExecutionStatus> {

	/**
	 * Special well-known status value.
	 */
	public static final FlowExecutionStatus COMPLETED = new FlowExecutionStatus(Status.COMPLETED.toString());

	/**
	 * Special well-known status value.
	 */
	public static final FlowExecutionStatus STOPPED = new FlowExecutionStatus(Status.STOPPED.toString());

	/**
	 * Special well-known status value.
	 */
	public static final FlowExecutionStatus FAILED = new FlowExecutionStatus(Status.FAILED.toString());

	/**
	 * Special well-known status value.
	 */
	public static final FlowExecutionStatus UNKNOWN = new FlowExecutionStatus(Status.UNKNOWN.toString());

	private final String name;

	private enum Status {

		COMPLETED, STOPPED, FAILED, UNKNOWN;

		static Status match(String value) {
			for (int i = 0; i < values().length; i++) {
				Status status = values()[i];
				if (value.startsWith(status.toString())) {
					return status;
				}
			}
			// Default match should be the lowest priority
			return COMPLETED;
		}

	}

	/**
	 * @param status String status value.
	 */
	public FlowExecutionStatus(String status) {
		this.name = status;
	}

	/**
	 * @return true if the status starts with "STOPPED"
	 */
	public boolean isStop() {
		return name.startsWith(STOPPED.getName());
	}

	/**
	 * @return true if the status starts with "FAILED"
	 */
	public boolean isFail() {
		return name.startsWith(FAILED.getName());
	}

	/**
	 * @return true if this status represents the end of a flow
	 */
	public boolean isEnd() {
		return isStop() || isFail() || isComplete();
	}

	/**
	 * @return true if the status starts with "COMPLETED"
	 */
	private boolean isComplete() {
		return name.startsWith(COMPLETED.getName());
	}

	/**
	 * Create an ordering on {@link FlowExecutionStatus} instances by comparing their
	 * statuses.
	 *
	 * @see Comparable#compareTo(Object)
	 * @param other instance of {@link FlowExecutionStatus} to compare this instance with.
	 * @return negative, zero or positive as per the contract
	 */
	@Override
	public int compareTo(FlowExecutionStatus other) {<FILL_FUNCTION_BODY>}

	/**
	 * Check the equality of the statuses.
	 *
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object object) {
		if (object == this) {
			return true;
		}
		if (!(object instanceof FlowExecutionStatus other)) {
			return false;
		}
		return name.equals(other.name);
	}

	@Override
	public int hashCode() {
		return name.hashCode();
	}

	/**
	 * @see Object#toString()
	 */
	@Override
	public String toString() {
		return name;
	}

	/**
	 * @return the name of this status
	 */
	public String getName() {
		return name;
	}

}

		Status one = Status.match(this.name);
		Status two = Status.match(other.name);
		int comparison = one.compareTo(two);
		if (comparison == 0) {
			return this.name.compareTo(other.name);
		}
		return comparison;
	
<no_super_class>