protected static function compact( array $lists, $outerSep ) {
		$consolidated = [];
		foreach ( $lists as $list ) {
			if ( !$list instanceof WrappedStringList ) {
				// Probably WrappedString or regular string,
				// Not mergable as a list, but may be merged as a string
				// later by WrappedString::compact.
				$consolidated[] = $list;
				continue;
			}
			if ( $list->sep === $outerSep ) {
				$consolidated = array_merge(
					$consolidated,
					self::compact( $list->wraps, $outerSep )
				);
			} else {
				$consolidated[] = $list;
			}
		}

		return WrappedString::compact( $consolidated );
	}