Repository: 7mind/izumi
Pull request #1004 (2020-04-16 04:02:32)

Update magnolia to 0.14.5
Updates [com.propensive:magnolia](https://github.com/propensive/magnolia) from 0.14.4 to 0.14.5.
[GitHub Release Notes](https://github.com/propensive/magnolia/releases/tag/v0.14.5) - [Version Diff](https://github.com/propensive/magnolia/compare/v0.14.4...v0.14.5)

I'll automatically update this PR to resolve conflicts as long as you don't change it yourself.

If you'd like to skip this version, you can just close this PR. If you have any feedback, just mention me in the comments below.

Configure Scala Steward for your repository with a [`.scala-steward.conf`](https://github.com/fthomas/scala-steward/blob/3a42f4618729a130494e7f95f629006cab8a2615/docs/repo-specific-configuration.md) file.

Have a fantastic day writing Scala!

<details>
<summary>Ignore future updates</summary>

Add this to your `.scala-steward.conf` file to ignore future updates of this dependency:
```
updates.ignore = [ { groupId = "com.propensive", artifactId = "magnolia" } ]
```
</details>

labels: library-update, semver-patch


Patch:
diff --git a/fundamentals/fundamentals-collections/src/main/scala/izumi/fundamentals/collections/nonempty/NonEmptyList.scala b/fundamentals/fundamentals-collections/src/main/scala/izumi/fundamentals/collections/nonempty/NonEmptyList.scala
new file mode 100644
index 000000000..429fcb6c4
--- /dev/null
+++ b/fundamentals/fundamentals-collections/src/main/scala/izumi/fundamentals/collections/nonempty/NonEmptyList.scala
@@ -0,0 +1,1476 @@
+package izumi.fundamentals.collections.nonempty
+
+// shameless copypaste from Scalactic
+
+import scala.collection.compat._
+import scala.collection.mutable.{ArrayBuffer, Buffer}
+import scala.collection.{Iterable, Seq, mutable}
+import scala.reflect.ClassTag
+
+
+
+final class NonEmptyList[+T] private (val toList: List[T]) extends AnyVal {
+
+  /**
+    * Returns a new <code>NonEmptyList</code> containing the elements of this <code>NonEmptyList</code> followed by the elements of the passed <code>NonEmptyList</code>.
+    * The element type of the resulting <code>NonEmptyList</code> is the most specific superclass encompassing the element types of this and the passed <code>NonEmptyList</code>.
+    *
+    * @tparam U the element type of the returned <code>NonEmptyList</code>
+    * @param other the <code>NonEmptyList</code> to append
+    * @return a new <code>NonEmptyList</code> that contains all the elements of this <code>NonEmptyList</code> followed by all elements of <code>other</code>.
+    */
+  def ++[U >: T](other: NonEmptyList[U]): NonEmptyList[U] = new NonEmptyList(toList ++ other.toList)
+
+  /**
+    * Returns a new <code>NonEmptyList</code> containing the elements of this <code>NonEmptyList</code> followed by the elements of the passed <code>Vector</code>.
+    * The element type of the resulting <code>NonEmptyList</code> is the most specific superclass encompassing the element types of this <code>NonEmptyList</code> and the passed <code>Vector</code>.
+    *
+    * @tparam U the element type of the returned <code>NonEmptyList</code>
+    * @param other the <code>Vector</code> to append
+    * @return a new <code>NonEmptyList</code> that contains all the elements of this <code>NonEmptyList</code> followed by all elements of <code>other</code>.
+    */
+  def ++[U >: T](other: Vector[U]): NonEmptyList[U] = new NonEmptyList(toList ++ other)
+
+  // TODO: Have I added these extra ++, etc. methods to Vector that take a NonEmptyList?
+
+  /**
+    * Returns a new <code>NonEmptyList</code> containing the elements of this <code>NonEmptyList</code> followed by the elements of the passed <code>GenTraversableOnce</code>.
+    * The element type of the resulting <code>NonEmptyList</code> is the most specific superclass encompassing the element types of this <code>NonEmptyList</code>
+    * and the passed <code>GenTraversableOnce</code>.
+    *
+    * @tparam U the element type of the returned <code>NonEmptyList</code>
+    * @param other the <code>GenTraversableOnce</code> to append
+    * @return a new <code>NonEmptyList</code> that contains all the elements of this <code>NonEmptyList</code> followed by all elements of <code>other</code>.
+    */
+  def ++[U >: T](other: Iterable[U]): NonEmptyList[U] =
+    if (other.isEmpty) this else new NonEmptyList(toList ++ other.iterator)
+
+
+  /**
+    * Returns a new <code>NonEmptyList</code> with the given element prepended.
+    *
+    * <p>
+    * Note that :-ending operators are right associative. A mnemonic for <code>+:</code> <em>vs.</em> <code>:+</code> is: the COLon goes on the COLlection side.
+    * </p>
+    *
+    * @param element the element to prepend to this <code>NonEmptyList</code>
+    * @return a new <code>NonEmptyList</code> consisting of <code>element</code> followed by all elements of this <code>NonEmptyList</code>.
+    */
+  def +:[U >: T](element: U): NonEmptyList[U] = new NonEmptyList(element +: toList)
+
+  /**
+    * Adds an element to the beginning of this <code>NonEmptyList</code>.
+    *
+    * <p>
+    * Note that :-ending operators are right associative. A mnemonic for <code>+:</code> <em>vs.</em> <code>:+</code> is: the COLon goes on the COLlection side.
+    * </p>
+    *
+    * @param element the element to prepend to this <code>NonEmptyList</code>
+    * @return a <code>NonEmptyList</code> that contains <code>element</code> as first element and that continues with this <code>NonEmptyList</code>.
+    */
+  def ::[U >: T](element: U): NonEmptyList[U] = new NonEmptyList(element +: toList)
+
+  /**
+    * Returns a new <code>NonEmptyList</code> containing the elements of this <code>NonEmptyList</code> followed by the elements of the passed <code>NonEmptyList</code>.
+    * The element type of the resulting <code>NonEmptyList</code> is the most specific superclass encompassing the element types of this and the passed <code>NonEmptyList</code>.
+    *
+    * @tparam U the element type of the returned <code>NonEmptyList</code>
+    * @param other the <code>NonEmptyList</code> to append
+    * @return a new <code>NonEmptyList</code> that contains all the elements of this <code>NonEmptyList</code> followed by all elements of <code>other</code>.
+    */
+  def :::[U >: T](other: NonEmptyList[U]): NonEmptyList[U] = new NonEmptyList(other.toList ::: toList)
+
+  /**
+    * Returns a new <code>NonEmptyList</code> containing the elements of this <code>NonEmptyList</code> followed by the elements of the passed <code>Vector</code>.
+    * The element type of the resulting <code>NonEmptyList</code> is the most specific superclass encompassing the element types of this and the passed <code>Vector</code>.
+    *
+    * @tparam U the element type of the returned <code>NonEmptyList</code>
+    * @param other the <code>Vector</code> to append
+    * @return a new <code>NonEmptyList</code> that contains all the elements of this <code>NonEmptyList</code> followed by all elements of <code>other</code>.
+    */
+  def :::[U >: T](other: Vector[U]): NonEmptyList[U] = new NonEmptyList(other.toList ::: toList)
+
+  /**
+    * Returns a new <code>NonEmptyList</code> containing the elements of this <code>NonEmptyList</code> followed by the elements of the passed <code>GenTraversableOnce</code>.
+    * The element type of the resulting <code>NonEmptyList</code> is the most specific superclass encompassing the element types of this <code>NonEmptyList</code>
+    * and the passed <code>GenTraversableOnce</code>.
+    *
+    * @tparam U the element type of the returned <code>NonEmptyList</code>
+    * @param other the <code>GenTraversableOnce</code> to append
+    * @return a new <code>NonEmptyList</code> that contains all the elements of this <code>NonEmptyList</code> followed by all elements of <code>other</code>.
+    */
+  def :::[U >: T](other: IterableOnce[U]): NonEmptyList[U] =
+    if (other.iterator.isEmpty) this else new NonEmptyList(other.iterator.to(List) ::: toList)
+
+  /**
+    * Returns a new <code>NonEmptyList</code> with the given element appended.
+    *
+    * <p>
+    * Note a mnemonic for <code>+:</code> <em>vs.</em> <code>:+</code> is: the COLon goes on the COLlection side.
+    * </p>
+    *
+    * @param element the element to append to this <code>NonEmptyList</code>
+    * @return a new <code>NonEmptyList</code> consisting of all elements of this <code>NonEmptyList</code> followed by <code>element</code>.
+    */
+  def :+[U >: T](element: U): NonEmptyList[U] = new NonEmptyList(toList :+ element)
+
+  /**
+    * Appends all elements of this <code>NonEmptyList</code> to a string builder. The written text will consist of a concatenation of the result of invoking <code>toString</code>
+    * on of every element of this <code>NonEmptyList</code>, without any separator string.
+    *
+    * @param sb the string builder to which elements will be appended
+    * @return the string builder, <code>sb</code>, to which elements were appended.
+    */
+  def addString(sb: StringBuilder): StringBuilder = toList.addString(sb)
+
+  /**
+    * Appends all elements of this <code>NonEmptyList</code> to a string builder using a separator string. The written text will consist of a concatenation of the
+    * result of invoking <code>toString</code>
+    * on of every element of this <code>NonEmptyList</code>, separated by the string <code>sep</code>.
+    *
+    * @param sb the string builder to which elements will be appended
+    * @param sep the separator string
+    * @return the string builder, <code>sb</code>, to which elements were appended.
+    */
+  def addString(sb: StringBuilder, sep: String): StringBuilder = toList.addString(sb, sep)
+
+  /**
+    * Appends all elements of this <code>NonEmptyList</code> to a string builder using start, end, and separator strings. The written text will consist of a concatenation of
+    * the string <code>start</code>; the result of invoking <code>toString</code> on all elements of this <code>NonEmptyList</code>,
+    * separated by the string <code>sep</code>; and the string <code>end</code>
+    *
+    * @param sb the string builder to which elements will be appended
+    * @param start the starting string
+    * @param sep the separator string
+    * @param start the ending string
+    * @return the string builder, <code>sb</code>, to which elements were appended.
+    */
+  def addString(sb: StringBuilder, start: String, sep: String, end: String): StringBuilder = toList.addString(sb, start, sep, end)
+
+  /**
+    * Selects an element by its index in the <code>NonEmptyList</code>.
+    *
+    * @return the element of this <code>NonEmptyList</code> at index <code>idx</code>, where 0 indicates the first element.
+    */
+  def apply(idx: Int): T = toList(idx)
+
+  /**
+    * Finds the first element of this <code>NonEmptyList</code> for which the given partial function is defined, if any, and applies the partial function to it.
+    *
+    * @param pf the partial function
+    * @return an <code>Option</code> containing <code>pf</code> applied to the first element for which it is defined, or <code>None</code> if
+    *    the partial function was not defined for any element.
+    */
+  def collectFirst[U](pf: PartialFunction[T, U]): Option[U] = toList.collectFirst(pf)
+
+  /**
+    * Indicates whether this <code>NonEmptyList</code> contains a given value as an element.
+    *
+    * @param elem the element to look for
+    * @return true if this <code>NonEmptyList</code> has an element that is equal (as determined by <code>==)</code> to <code>elem</code>, false otherwise. 
+    */
+  def contains(elem: Any): Boolean = toList.contains(elem)
+
+  /**
+    * Indicates whether this <code>NonEmptyList</code> contains a given <code>Seq</code> as a slice.
+    *
+    * @param that the <code>Seq</code> slice to look for
+    * @return true if this <code>NonEmptyList</code> contains a slice with the same elements as <code>that</code>, otherwise <code>false</code>.
+    */
+  def containsSlice[B](that: Seq[B]): Boolean = toList.containsSlice(that)
+
+  /**
+    * Indicates whether this <code>NonEmptyList</code> contains a given <code>Vector</code> as a slice.
+    *
+    * @param that the <code>Vector</code> slice to look for
+    * @return true if this <code>NonEmptyList</code> contains a slice with the same elements as <code>that</code>, otherwise <code>false</code>.
+    */
+  def containsSlice[B](that: Vector[B]): Boolean = toList.containsSlice(that)
+
+  /**
+    * Indicates whether this <code>NonEmptyList</code> contains a given <code>NonEmptyList</code> as a slice.
+    *
+    * @param that the <code>NonEmptyList</code> slice to look for
+    * @return true if this <code>NonEmptyList</code> contains a slice with the same elements as <code>that</code>, otherwise <code>false</code>.
+    */
+  def containsSlice[B](that: NonEmptyList[B]): Boolean = toList.containsSlice(that.toList)
+
+  /**
+    * Copies values of this <code>NonEmptyList</code> to an array. Fills the given array <code>arr</code> with values of this <code>NonEmptyList</code>. Copying
+    * will stop once either the end of the current <code>NonEmptyList</code> is reached, or the end of the array is reached.
+    *
+    * @param arr the array to fill
+    */
+  def copyToArray[U >: T](arr: Array[U]): Unit = {
+    toList.copyToArray(arr)
+    ()
+  }
+
+  /**
+    * Copies values of this <code>NonEmptyList</code> to an array. Fills the given array <code>arr</code> with values of this <code>NonEmptyList</code>, beginning at
+    * index <code>start</code>. Copying will stop once either the end of the current <code>NonEmptyList</code> is reached, or the end of the array is reached.
+    *
+    * @param arr the array to fill
+    * @param start the starting index
+    */
+  def copyToArray[U >: T](arr: Array[U], start: Int): Unit = {
+    toList.copyToArray(arr, start)
+    ()
+  }
+
+  /**
+    * Copies values of this <code>NonEmptyList</code> to an array. Fills the given array <code>arr</code> with at most <code>len</code> elements of this <code>NonEmptyList</code>, beginning at
+    * index <code>start</code>. Copying will stop once either the end of the current <code>NonEmptyList</code> is reached, the end of the array is reached, or
+    * <code>len</code> elements have been copied.
+    *
+    * @param arr the array to fill
+    * @param start the starting index
+    * @param len the maximum number of elements to copy
+    */
+  def copyToArray[U >: T](arr: Array[U], start: Int, len: Int): Unit = {
+    toList.copyToArray(arr, start, len)
+    ()
+  }
+
+  /**
+    * Copies all elements of this <code>NonEmptyList</code> to a buffer. 
+    *
+    * @param buf the buffer to which elements are copied
+    */
+  def copyToBuffer[U >: T](buf: Buffer[U]): Unit = {
+    buf ++= toList
+    //toList.copyToBuffer(buf)
+  }
+
+  /**
+    * Indicates whether every element of this <code>NonEmptyList</code> relates to the corresponding element of a given <code>Seq</code> by satisfying a given predicate. 
+    *
+    * @tparam B the type of the elements of <code>that</code>
+    * @param that the <code>Seq</code> to compare for correspondence
+    * @param p the predicate, which relates elements from this <code>NonEmptyList</code> and the passed <code>Seq</code>
+    * @return true if this <code>NonEmptyList</code> and the passed <code>Seq</code> have the same length and <code>p(x, y)</code> is <code>true</code>
+    *     for all corresponding elements <code>x</code> of this <code>NonEmptyList</code> and <code>y</code> of that, otherwise <code>false</code>.
+    */
+  def corresponds[B](that: Seq[B])(p: (T, B) => Boolean): Boolean = toList.corresponds(that)(p)
+
+  /**
+    * Indicates whether every element of this <code>NonEmptyList</code> relates to the corresponding element of a given <code>Vector</code> by satisfying a given predicate. 
+    *
+    * @tparam B the type of the elements of <code>that</code>
+    * @param that the <code>Vector</code> to compare for correspondence
+    * @param p the predicate, which relates elements from this <code>NonEmptyList</code> and the passed <code>Vector</code>
+    * @return true if this <code>NonEmptyList</code> and the passed <code>Vector</code> have the same length and <code>p(x, y)</code> is <code>true</code>
+    *     for all corresponding elements <code>x</code> of this <code>NonEmptyList</code> and <code>y</code> of that, otherwise <code>false</code>.
+    */
+  def corresponds[B](that: Vector[B])(p: (T, B) => Boolean): Boolean = toList.corresponds(that)(p)
+
+  /**
+    * Indicates whether every element of this <code>NonEmptyList</code> relates to the corresponding element of a given <code>NonEmptyList</code> by satisfying a given predicate. 
+    *
+    * @tparam B the type of the elements of <code>that</code>
+    * @param that the <code>NonEmptyList</code> to compare for correspondence
+    * @param p the predicate, which relates elements from this and the passed <code>NonEmptyList</code>
+    * @return true if this and the passed <code>NonEmptyList</code> have the same length and <code>p(x, y)</code> is <code>true</code>
+    *     for all corresponding elements <code>x</code> of this <code>NonEmptyList</code> and <code>y</code> of that, otherwise <code>false</code>.
+    */
+  def corresponds[B](that: NonEmptyList[B])(p: (T, B) => Boolean): Boolean = toList.corresponds(that.toList)(p)
+
+  /**
+    * Counts the number of elements in this <code>NonEmptyList</code> that satisfy a predicate. 
+    *
+    * @param p the predicate used to test elements.
+    * @return the number of elements satisfying the predicate <code>p</code>. 
+    */
+  def count(p: T => Boolean): Int = toList.count(p)
+
+  /**
+    * Builds a new <code>NonEmptyList</code> from this <code>NonEmptyList</code> without any duplicate elements.
+    *
+    * @return A new <code>NonEmptyList</code> that contains the first occurrence of every element of this <code>NonEmptyList</code>. 
+    */
+  def distinct: NonEmptyList[T] = new NonEmptyList(toList.distinct)
+
+  /**
+    * Indicates whether this <code>NonEmptyList</code> ends with the given <code>Seq</code>.
+    *
+    * @param that the sequence to test
+    * @return <code>true</code> if this <code>NonEmptyList</code> has <code>that</code> as a suffix, <code>false</code> otherwise. 
+    */
+  def endsWith[B](that: Seq[B]): Boolean = toList.endsWith[Any](that)
+
+  /**
+    * Indicates whether this <code>NonEmptyList</code> ends with the given <code>Vector</code>.
+    *
+    * @param that the <code>Vector</code> to test
+    * @return <code>true</code> if this <code>NonEmptyList</code> has <code>that</code> as a suffix, <code>false</code> otherwise. 
+    */
+  def endsWith[B](that: Vector[B]): Boolean = toList.endsWith[Any](that)
+
+  // TODO: Search for that: Vector in here and add a that: NonEmptyList in Vector.
+  /**
+    * Indicates whether this <code>NonEmptyList</code> ends with the given <code>NonEmptyList</code>.
+    *
+    * @param that the <code>NonEmptyList</code> to test
+    * @return <code>true</code> if this <code>NonEmptyList</code> has <code>that</code> as a suffix, <code>false</code> otherwise. 
+    */
+  def endsWith[B](that: NonEmptyList[B]): Boolean = toList.endsWith[Any](that.toList)
+
+  /*
+    override def equals(o: Any): Boolean =
+      o match {
+        case nonEmptyList: NonEmptyList[_] => toList == nonEmptyList.toList
+        case _ => false
+      }
+  */
+
+  /**
+    * Indicates whether a predicate holds for at least one of the elements of this <code>NonEmptyList</code>.
+    *
+    * @param the predicate used to test elements.
+    * @return <code>true</code> if the given predicate <code>p</code> holds for some of the elements of this <code>NonEmptyList</code>, otherwise <code>false</code>. 
+    */
+  def exists(p: T => Boolean): Boolean = toList.exists(p)
+
+  /**
+    * Finds the first element of this <code>NonEmptyList</code> that satisfies the given predicate, if any.
+    *
+    * @param p the predicate used to test elements
+    * @return an <code>Some</code> containing the first element in this <code>NonEmptyList</code> that satisfies <code>p</code>, or <code>None</code> if none exists. 
+    */
+  def find(p: T => Boolean): Option[T] = toList.find(p)
+
+  /**
+    * Builds a new <code>NonEmptyList</code> by applying a function to all elements of this <code>NonEmptyList</code> and using the elements of the resulting <code>NonEmptyList</code>s.
+    *
+    * @tparam U the element type of the returned <code>NonEmptyList</code>
+    * @param f the function to apply to each element.
+    * @return a new <code>NonEmptyList</code> containing elements obtained by applying the given function <code>f</code> to each element of this <code>NonEmptyList</code> and concatenating
+    *    the elements of resulting <code>NonEmptyList</code>s. 
+    */
+  def flatMap[U](f: T => NonEmptyList[U]): NonEmptyList[U] = {
+    val buf = new ArrayBuffer[U]
+    for (ele <- toList)
+      buf ++= f(ele).toList
+    new NonEmptyList(buf.toList)
+  }
+
+  /**
+    * Converts this <code>NonEmptyList</code> of <code>NonEmptyList</code>s into a <code>NonEmptyList</code>
+    * formed by the elements of the nested <code>NonEmptyList</code>s.
+    *
+    * <p>
+    * Note: You cannot use this <code>flatten</code> method on a <code>NonEmptyList</code> that contains a <code>GenTraversableOnce</code>s, because 
+    * if all the nested <code>GenTraversableOnce</code>s were empty, you'd end up with an empty <code>NonEmptyList</code>.
+    * </p>
+    *
+    * @tparm B the type of the elements of each nested <code>NonEmptyList</code>
+    * @return a new <code>NonEmptyList</code> resulting from concatenating all nested <code>NonEmptyList</code>s.
+    */
+  def flatten[B](implicit ev: T <:< NonEmptyList[B]): NonEmptyList[B] = flatMap(ev)
+
+  /**
+    * Folds the elements of this <code>NonEmptyList</code> using the specified associative binary operator.
+    *
+    * <p>
+    * The order in which operations are performed on elements is unspecified and may be nondeterministic. 
+    * </p>
+    *
+    * @tparam U a type parameter for the binary operator, a supertype of T.
+    * @param z a neutral element for the fold operation; may be added to the result an arbitrary number of
+    *     times, and must not change the result (<em>e.g.</em>, <code>Nil</code> for list concatenation,
+    *     0 for addition, or 1 for multiplication.)
+    * @param op a binary operator that must be associative
+    * @return the result of applying fold operator <code>op</code> between all the elements and <code>z</code>
+    */
+  def fold[U >: T](z: U)(op: (U, U) => U): U = toList.fold(z)(op)
+
+  /**
+    * Applies a binary operator to a start value and all elements of this <code>NonEmptyList</code>, going left to right.
+    *
+    * @tparam B the result type of the binary operator.
+    * @param z the start value.
+    * @param op the binary operator.
+    * @return the result of inserting <code>op</code> between consecutive elements of this <code>NonEmptyList</code>, going left to right, with the start value,
+    *     <code>z</code>, on the left:
+    *
+    * <pre>
+    * op(...op(op(z, x_1), x_2), ..., x_n)
+    * </pre>
+    *
+    * <p>
+    * where x<sub>1</sub>, ..., x<sub>n</sub> are the elements of this <code>NonEmptyList</code>. 
+    * </p>
+    */
+  def foldLeft[B](z: B)(op: (B, T) => B): B = toList.foldLeft(z)(op)
+
+  /**
+    * Applies a binary operator to all elements of this <code>NonEmptyList</code> and a start value, going right to left.
+    *
+    * @tparam B the result of the binary operator
+    * @param z the start value
+    * @param op the binary operator
+    * @return the result of inserting <code>op</code> between consecutive elements of this <code>NonEmptyList</code>, going right to left, with the start value,
+    *     <code>z</code>, on the right:
+    *
+    * <pre>
+    * op(x_1, op(x_2, ... op(x_n, z)...))
+    * </pre>
+    *
+    * <p>
+    * where x<sub>1</sub>, ..., x<sub>n</sub> are the elements of this <code>NonEmptyList</code>. 
+    * </p>
+    */
+  def foldRight[B](z: B)(op: (T, B) => B): B = toList.foldRight(z)(op)
+
+  /**
+    * Indicates whether a predicate holds for all elements of this <code>NonEmptyList</code>.
+    *
+    * @param p the predicate used to test elements.
+    * @return <code>true</code> if the given predicate <code>p</code> holds for all elements of this <code>NonEmptyList</code>, otherwise <code>false</code>. 
+    */
+  def forall(p: T => Boolean): Boolean = toList.forall(p)
+
+  /**
+    * Applies a function <code>f</code> to all elements of this <code>NonEmptyList</code>.
+    *
+    * @param f the function that is applied for its side-effect to every element. The result of function <code>f</code> is discarded.
+    */
+  def foreach(f: T => Unit): Unit = toList.foreach(f)
+
+  /**
+    * Partitions this <code>NonEmptyList</code> into a map of <code>NonEmptyList</code>s according to some discriminator function.
+    *
+    * @tparam K the type of keys returned by the discriminator function.
+    * @param f the discriminator function.
+    * @return A map from keys to <code>NonEmptyList</code>s such that the following invariant holds:
+    *
+    * <pre>
+    * (nonEmptyList.toList partition f)(k) = xs filter (x =&gt; f(x) == k)
+    * </pre>
+    *
+    * <p>
+    * That is, every key <code>k</code> is bound to a <code>NonEmptyList</code> of those elements <code>x</code> for which <code>f(x)</code> equals <code>k</code>.
+    * </p>
+    */
+  def groupBy[K](f: T => K): Map[K, NonEmptyList[T]] = {
+    val mapKToList = toList.groupBy(f)
+    mapKToList.view.mapValues { list => new NonEmptyList(list) }.toMap
+  }
+
+  /**
+    * Partitions elements into fixed size <code>NonEmptyList</code>s.
+    *
+    * @param size the number of elements per group
+    * @return An iterator producing <code>NonEmptyList</code>s of size <code>size</code>, except the last will be truncated if the elements don't divide evenly. 
+    */
+  def grouped(size: Int): Iterator[NonEmptyList[T]] = {
+    val itOfList = toList.grouped(size)
+    itOfList.map { list => new NonEmptyList(list) }
+  }
+
+  /**
+    * Returns <code>true</code> to indicate this <code>NonEmptyList</code> has a definite size, since all <code>NonEmptyList</code>s are strict collections.
+    */
+  def hasDefiniteSize: Boolean = true
+
+  // override def hashCode: Int = toList.hashCode
+
+  /**
+    * Selects the first element of this <code>NonEmptyList</code>. 
+    *
+    * @return the first element of this <code>NonEmptyList</code>.
+    */
+  def head: T = toList.head
+
+  /**
+    * Finds index of first occurrence of some value in this <code>NonEmptyList</code>.
+    *
+    * @param elem the element value to search for. 
+    * @return the index of the first element of this <code>NonEmptyList</code> that is equal (as determined by <code>==</code>) to <code>elem</code>,
+    *     or <code>-1</code>, if none exists.
+    */
+  def indexOf[U >: T](elem: U): Int = toList.indexOf(elem, 0)
+
+  /**
+    * Finds index of first occurrence of some value in this <code>NonEmptyList</code> after or at some start index.
+    *
+    * @param elem the element value to search for. 
+    * @param from the start index
+    * @return the index <code>&gt;=</code> <code>from</code> of the first element of this <code>NonEmptyList</code> that is equal (as determined by <code>==</code>) to <code>elem</code>,
+    *     or <code>-1</code>, if none exists.
+    */
+  def indexOf[U >: T](elem: U, from: Int): Int = toList.indexOf(elem, from)
+
+
+  /**
+    * Finds first index where this <code>NonEmptyList</code> contains a given <code>Seq</code> as a slice.
+    *
+    * @param that the <code>Seq</code> defining the slice to look for
+    * @return the first index at which the elements of this <code>NonEmptyList</code> starting at that index match the elements of
+    *     <code>Seq</code> <code>that</code>, or <code>-1</code> of no such subsequence exists. 
+    */
+  def indexOfSlice[U >: T](that: Seq[U]): Int = toList.indexOfSlice(that)
+
+  /**
+    * Finds first index after or at a start index where this <code>NonEmptyList</code> contains a given <code>Seq</code> as a slice.
+    *
+    * @param that the <code>Seq</code> defining the slice to look for
+    * @param from the start index
+    * @return the first index <code>&gt;=</code> <code>from</code> at which the elements of this <code>NonEmptyList</code> starting at that index match the elements of
+    *     <code>Seq</code> <code>that</code>, or <code>-1</code> of no such subsequence exists. 
+    */
+  def indexOfSlice[U >: T](that: Seq[U], from: Int): Int = toList.indexOfSlice(that, from)
+
+  /**
+    * Finds first index where this <code>NonEmptyList</code> contains a given <code>Vector</code> as a slice.
+    *
+    * @param that the <code>Vector</code> defining the slice to look for
+    * @return the first index such that the elements of this <code>NonEmptyList</code> starting at this index match the elements of
+    *     <code>Vector</code> <code>that</code>, or <code>-1</code> of no such subsequence exists. 
+    */
+  def indexOfSlice[U >: T](that: Vector[U]): Int = toList.indexOfSlice(that)
+
+  /**
+    * Finds first index where this <code>NonEmptyList</code> contains a given <code>NonEmptyList</code> as a slice.
+    *
+    * @param that the <code>NonEmptyList</code> defining the slice to look for
+    * @return the first index such that the elements of this <code>NonEmptyList</code> starting at this index match the elements of
+    *     <code>NonEmptyList</code> <code>that</code>, or <code>-1</code> of no such subsequence exists. 
+    */
+  def indexOfSlice[U >: T](that: NonEmptyList[U]): Int = toList.indexOfSlice(that.toList)
+
+  /**
+    * Finds first index after or at a start index where this <code>NonEmptyList</code> contains a given <code>Vector</code> as a slice.
+    *
+    * @param that the <code>Vector</code> defining the slice to look for
+    * @param from the start index
+    * @return the first index <code>&gt;=</code> <code>from</code> such that the elements of this <code>NonEmptyList</code> starting at this index match the elements of
+    *     <code>Vector</code> <code>that</code>, or <code>-1</code> of no such subsequence exists. 
+    */
+  def indexOfSlice[U >: T](that: Vector[U], from: Int): Int = toList.indexOfSlice(that, from)
+
+  /**
+    * Finds first index after or at a start index where this <code>NonEmptyList</code> contains a given <code>NonEmptyList</code> as a slice.
+    *
+    * @param that the <code>NonEmptyList</code> defining the slice to look for
+    * @param from the start index
+    * @return the first index <code>&gt;=</code> <code>from</code> such that the elements of this <code>NonEmptyList</code> starting at this index match the elements of
+    *     <code>NonEmptyList</code> <code>that</code>, or <code>-1</code> of no such subsequence exists. 
+    */
+  def indexOfSlice[U >: T](that: NonEmptyList[U], from: Int): Int = toList.indexOfSlice(that.toList, from)
+
+  /**
+    * Finds index of the first element satisfying some predicate.
+    *
+    * @param p the predicate used to test elements.
+    * @return the index of the first element of this <code>NonEmptyList</code> that satisfies the predicate <code>p</code>,
+    *     or <code>-1</code>, if none exists.
+    */
+  def indexWhere(p: T => Boolean): Int = toList.indexWhere(p)
+
+  /**
+    * Finds index of the first element satisfying some predicate after or at some start index.
+    *
+    * @param p the predicate used to test elements.
+    * @param from the start index
+    * @return the index <code>&gt;=</code> <code>from</code> of the first element of this <code>NonEmptyList</code> that satisfies the predicate <code>p</code>,
+    *     or <code>-1</code>, if none exists.
+    */
+  def indexWhere(p: T => Boolean, from: Int): Int = toList.indexWhere(p, from)
+
+  /**
+    * Produces the range of all indices of this <code>NonEmptyList</code>. 
+    *
+    * @return a <code>Range</code> value from <code>0</code> to one less than the length of this <code>NonEmptyList</code>. 
+    */
+  def indices: Range = toList.indices
+
+  /**
+    * Tests whether this <code>NonEmptyList</code> contains given index.
+    *
+    * @param idx the index to test
+    * @return true if this <code>NonEmptyList</code> contains an element at position <code>idx</code>, <code>false</code> otherwise. 
+    */
+  def isDefinedAt(idx: Int): Boolean = toList.isDefinedAt(idx)
+
+  /**
+    * Returns <code>false</code> to indicate this <code>NonEmptyList</code>, like all <code>NonEmptyList</code>s, is non-empty.
+    *
+    * @return false
+    */
+  def isEmpty: Boolean = false
+
+  /**
+    * Returns <code>true</code> to indicate this <code>NonEmptyList</code>, like all <code>NonEmptyList</code>s, can be traversed repeatedly.
+    *
+    * @return true
+    */
+  def isTraversableAgain: Boolean = true
+
+  /**
+    * Creates and returns a new iterator over all elements contained in this <code>NonEmptyList</code>.
+    *
+    * @return the new iterator
+    */
+  def iterator: Iterator[T] = toList.iterator
+
+  /**
+    * Selects the last element of this <code>NonEmptyList</code>. 
+    *
+    * @return the last element of this <code>NonEmptyList</code>.
+    */
+  def last: T = toList.last
+
+  /**
+    * Finds the index of the last occurrence of some value in this <code>NonEmptyList</code>.
+    *
+    * @param elem the element value to search for.
+    * @return the index of the last element of this <code>NonEmptyList</code> that is equal (as determined by <code>==</code>) to <code>elem</code>,
+    *     or <code>-1</code>, if none exists.
+    */
+  def lastIndexOf[U >: T](elem: U): Int = toList.lastIndexOf(elem)
+
+  /**
+    * Finds the index of the last occurrence of some value in this <code>NonEmptyList</code> before or at a given <code>end</code> index.
+    *
+    * @param elem the element value to search for.
+    * @param end the end index. 
+    * @return the index <code>&gt;=</code> <code>end</code> of the last element of this <code>NonEmptyList</code> that is equal (as determined by <code>==</code>)
+    *     to <code>elem</code>, or <code>-1</code>, if none exists.
+    */
+  def lastIndexOf[U >: T](elem: U, end: Int): Int = toList.lastIndexOf(elem, end)
+
+  /**
+    * Finds the last index where this <code>NonEmptyList</code> contains a given <code>Seq</code> as a slice. 
+    *
+    * @param that the <code>Seq</code> defining the slice to look for
+    * @return the last index at which the elements of this <code>NonEmptyList</code> starting at that index match the elements of
+    *    <code>Seq</code> <code>that</code>, or <code>-1</code> of no such subsequence exists. 
+    */
+  def lastIndexOfSlice[U >: T](that: Seq[U]): Int = toList.lastIndexOfSlice(that)
+
+  /**
+    * Finds the last index before or at a given end index where this <code>NonEmptyList</code> contains a given <code>Seq</code> as a slice. 
+    *
+    * @param that the <code>Seq</code> defining the slice to look for
+    * @param end the end index
+    * @return the last index <code>&gt;=</code> <code>end</code> at which the elements of this <code>NonEmptyList</code> starting at that index match the elements of
+    *    <code>Seq</code> <code>that</code>, or <code>-1</code> of no such subsequence exists. 
+    */
+  def lastIndexOfSlice[U >: T](that: Seq[U], end: Int): Int = toList.lastIndexOfSlice(that, end)
+
+  /**
+    * Finds the last index where this <code>NonEmptyList</code> contains a given <code>Vector</code> as a slice. 
+    *
+    * @param that the <code>Vector</code> defining the slice to look for
+    * @return the last index at which the elements of this <code>NonEmptyList</code> starting at that index match the elements of
+    *    <code>Vector</code> <code>that</code>, or <code>-1</code> of no such subsequence exists. 
+    */
+  def lastIndexOfSlice[U >: T](that: Vector[U]): Int = toList.lastIndexOfSlice(that)
+
+  /**
+    * Finds the last index where this <code>NonEmptyList</code> contains a given <code>NonEmptyList</code> as a slice. 
+    *
+    * @param that the <code>NonEmptyList</code> defining the slice to look for
+    * @return the last index at which the elements of this <code>NonEmptyList</code> starting at that index match the elements of
+    *    <code>NonEmptyList</code> <code>that</code>, or <code>-1</code> of no such subsequence exists. 
+    */
+  def lastIndexOfSlice[U >: T](that: NonEmptyList[U]): Int = toList.lastIndexOfSlice(that.toList)
+
+  /**
+    * Finds the last index before or at a given end index where this <code>NonEmptyList</code> contains a given <code>Vector</code> as a slice. 
+    *
+    * @param that the <code>Vector</code> defining the slice to look for
+    * @param end the end index
+    * @return the last index <code>&gt;=</code> <code>end</code> at which the elements of this <code>NonEmptyList</code> starting at that index match the elements of
+    *    <code>Vector</code> <code>that</code>, or <code>-1</code> of no such subsequence exists. 
+    */
+  def lastIndexOfSlice[U >: T](that: Vector[U], end: Int): Int = toList.lastIndexOfSlice(that, end)
+
+  /**
+    * Finds the last index before or at a given end index where this <code>NonEmptyList</code> contains a given <code>NonEmptyList</code> as a slice. 
+    *
+    * @param that the <code>NonEmptyList</code> defining the slice to look for
+    * @param end the end index
+    * @return the last index <code>&gt;=</code> <code>end</code> at which the elements of this <code>NonEmptyList</code> starting at that index match the elements of
+    *    <code>NonEmptyList</code> <code>that</code>, or <code>-1</code> of no such subsequence exists. 
+    */
+  def lastIndexOfSlice[U >: T](that: NonEmptyList[U], end: Int): Int = toList.lastIndexOfSlice(that.toList, end)
+
+  /**
+    * Finds index of last element satisfying some predicate.
+    *
+    * @param p the predicate used to test elements.
+    * @return the index of the last element of this <code>NonEmptyList</code> that satisfies the predicate <code>p</code>, or <code>-1</code>, if none exists. 
+    */
+  def lastIndexWhere(p: T => Boolean): Int = toList.lastIndexWhere(p)
+
+  /**
+    * Finds index of last element satisfying some predicate before or at given end index.
+    *
+    * @param p the predicate used to test elements.
+    * @param end the end index
+    * @return the index <code>&gt;=</code> <code>end</code> of the last element of this <code>NonEmptyList</code> that satisfies the predicate <code>p</code>,
+    *     or <code>-1</code>, if none exists. 
+    */
+  def lastIndexWhere(p: T => Boolean, end: Int): Int = toList.lastIndexWhere(p, end)
+
+  /**
+    * The length of this <code>NonEmptyList</code>.
+    *
+    * <p>
+    * Note: <code>length</code> and <code>size</code> yield the same result, which will be <code>&gt;</code>= 1. 
+    * </p>
+    *
+    * @return the number of elements in this <code>NonEmptyList</code>. 
+    */
+  def length: Int = toList.length
+
+  /**
+    * Compares the length of this <code>NonEmptyList</code> to a test value. 
+    *
+    * @param len the test value that gets compared with the length.
+    * @return a value <code>x</code> where
+    *
+    * <pre>
+    * x &lt; 0 if this.length &lt; len
+    * x == 0 if this.length == len
+    * x &gt; 0 if this.length &gt; len
+    * </pre>
+    */
+  def lengthCompare(len: Int): Int = toList.lengthCompare(len)
+
+  /**
+    * Builds a new <code>NonEmptyList</code> by applying a function to all elements of this <code>NonEmptyList</code>.
+    *
+    * @tparam U the element type of the returned <code>NonEmptyList</code>.
+    * @param f the function to apply to each element. 
+    * @return a new <code>NonEmptyList</code> resulting from applying the given function <code>f</code> to each element of this <code>NonEmptyList</code> and collecting the results. 
+    */
+  def map[U](f: T => U): NonEmptyList[U] =
+    new NonEmptyList(toList.map(f))
+
+  /**
+    * Finds the largest element.
+    *
+    * @return the largest element of this <code>NonEmptyList</code>. 
+    */
+  def max[U >: T](implicit cmp: Ordering[U]): T = toList.max(cmp)
+
+  /**
+    * Finds the largest result after applying the given function to every element.
+    *
+    * @return the largest result of applying the given function to every element of this <code>NonEmptyList</code>. 
+    */
+  def maxBy[U](f: T => U)(implicit cmp: Ordering[U]): T = toList.maxBy(f)(cmp)
+
+  /**
+    * Finds the smallest element.
+    *
+    * @return the smallest element of this <code>NonEmptyList</code>. 
+    */
+  def min[U >: T](implicit cmp: Ordering[U]): T = toList.min(cmp)
+
+  /**
+    * Finds the smallest result after applying the given function to every element.
+    *
+    * @return the smallest result of applying the given function to every element of this <code>NonEmptyList</code>. 
+    */
+  def minBy[U](f: T => U)(implicit cmp: Ordering[U]): T = toList.minBy(f)(cmp)
+
+  /**
+    * Displays all elements of this <code>NonEmptyList</code> in a string. 
+    *
+    * @return a string representation of this <code>NonEmptyList</code>. In the resulting string, the result of invoking <code>toString</code> on all elements of this
+    *     <code>NonEmptyList</code> follow each other without any separator string. 
+    */
+  def mkString: String = toList.mkString
+
+  /**
+    * Displays all elements of this <code>NonEmptyList</code> in a string using a separator string. 
+    *
+    * @param sep the separator string
+    * @return a string representation of this <code>NonEmptyList</code>. In the resulting string, the result of invoking <code>toString</code> on all elements of this
+    *     <code>NonEmptyList</code> are separated by the string <code>sep</code>. 
+    */
+  def mkString(sep: String): String = toList.mkString(sep)
+
+  /**
+    * Displays all elements of this <code>NonEmptyList</code> in a string using start, end, and separator strings. 
+    *
+    * @param start the starting string.
+    * @param sep the separator string.
+    * @param end the ending string.
+    * @return a string representation of this <code>NonEmptyList</code>. The resulting string begins with the string <code>start</code> and ends with the string
+    *     <code>end</code>. Inside, In the resulting string, the result of invoking <code>toString</code> on all elements of this <code>NonEmptyList</code> are
+    *     separated by the string <code>sep</code>. 
+    */
+  def mkString(start: String, sep: String, end: String): String = toList.mkString(start, sep, end)
+
+  /**
+    * Returns <code>true</code> to indicate this <code>NonEmptyList</code>, like all <code>NonEmptyList</code>s, is non-empty.
+    *
+    * @return true
+    */
+  def nonEmpty: Boolean = true
+
+  /**
+    * A copy of this <code>NonEmptyList</code> with an element value appended until a given target length is reached.
+    *
+    * @param len the target length 
+    * @param elem he padding value
+    * @return a new <code>NonEmptyList</code> consisting of all elements of this <code>NonEmptyList</code> followed by the minimal number of occurrences
+    *     of <code>elem</code> so that the resulting <code>NonEmptyList</code> has a length of at least <code>len</code>. 
+    */
+  def padTo[U >: T](len: Int, elem: U): NonEmptyList[U] =
+    new NonEmptyList(toList.padTo(len, elem))
+
+  /**
+    * Produces a new <code>NonEmptyList</code> where a slice of elements in this <code>NonEmptyList</code> is replaced by another <code>NonEmptyList</code>
+    *
+    * @param from the index of the first replaced element 
+    * @param that the <code>NonEmptyList</code> whose elements should replace a slice in this <code>NonEmptyList</code>
+    * @param replaced the number of elements to drop in the original <code>NonEmptyList</code>
+    */
+  def patch[U >: T](from: Int, that: NonEmptyList[U], replaced: Int): NonEmptyList[U] =
+    new NonEmptyList(toList.patch(from, that.toVector, replaced))
+
+  /**
+    * Iterates over distinct permutations. 
+    *
+    * <p>
+    * Here's an example:
+    * </p>
+    *
+    * <pre class="stHighlight">
+    * NonEmptyList('a', 'b', 'b').permutations.toList = List(NonEmptyList(a, b, b), NonEmptyList(b, a, b), NonEmptyList(b, b, a))
+    * </pre>
+    *
+    * @return an iterator that traverses the distinct permutations of this <code>NonEmptyList</code>.
+    */
+  def permutations: Iterator[NonEmptyList[T]] = {
+    val it = toList.permutations
+    it map { list => new NonEmptyList(list) }
+  }
+
+  /**
+    * Returns the length of the longest prefix whose elements all satisfy some predicate.
+    *
+    * @param p the predicate used to test elements.
+    * @return the length of the longest prefix of this <code>NonEmptyList</code> such that every element
+    *     of the segment satisfies the predicate <code>p</code>. 
+    */
+  def prefixLength(p: T => Boolean): Int = toList.segmentLength(p, 0)
+
+  /**
+    * The result of multiplying all the elements of this <code>NonEmptyList</code>.
+    *
+    * <p>
+    * This method can be invoked for any <code>NonEmptyList[T]</code> for which an implicit <code>Numeric[T]</code> exists.
+    * </p>
+    *
+    * @return the product of all elements
+    */
+  def product[U >: T](implicit num: Numeric[U]): U = toList.product(num)
+
+  /**
+    * Reduces the elements of this <code>NonEmptyList</code> using the specified associative binary operator.
+    *
+    * <p>
+    * The order in which operations are performed on elements is unspecified and may be nondeterministic. 
+    * </p>
+    *
+    * @tparam U a type parameter for the binary operator, a supertype of T.
+    * @param op a binary operator that must be associative.
+    * @return the result of applying reduce operator <code>op</code> between all the elements of this <code>NonEmptyList</code>.
+    */
+  def reduce[U >: T](op: (U, U) => U): U = toList.reduce(op)
+
+  /**
+    * Applies a binary operator to all elements of this <code>NonEmptyList</code>, going left to right.
+    *
+    * @tparam U the result type of the binary operator.
+    * @param op the binary operator.
+    * @return the result of inserting <code>op</code> between consecutive elements of this <code>NonEmptyList</code>, going left to right:
+    *
+    * <pre>
+    * op(...op(op(x_1, x_2), x_3), ..., x_n)
+    * </pre>
+    *
+    * <p>
+    * where x<sub>1</sub>, ..., x<sub>n</sub> are the elements of this <code>NonEmptyList</code>. 
+    * </p>
+    */
+  def reduceLeft[U >: T](op: (U, T) => U): U = toList.reduceLeft(op)
+
+  /**
+    * Applies a binary operator to all elements of this <code>NonEmptyList</code>, going left to right, returning the result in a <code>Some</code>.
+    *
+    * @tparam U the result type of the binary operator.
+    * @param op the binary operator.
+    * @return a <code>Some</code> containing the result of <code>reduceLeft(op)</code>
+    * </p>
+    */
+  def reduceLeftOption[U >: T](op: (U, T) => U): Option[U] = toList.reduceLeftOption(op)
+
+  def reduceOption[U >: T](op: (U, U) => U): Option[U] = toList.reduceOption(op)
+
+  /**
+    * Applies a binary operator to all elements of this <code>NonEmptyList</code>, going right to left.
+    *
+    * @tparam U the result of the binary operator
+    * @param op the binary operator
+    * @return the result of inserting <code>op</code> between consecutive elements of this <code>NonEmptyList</code>, going right to left:
+    *
+    * <pre>
+    * op(x_1, op(x_2, ... op(x_{n-1}, x_n)...))
+    * </pre>
+    *
+    * <p>
+    * where x<sub>1</sub>, ..., x<sub>n</sub> are the elements of this <code>NonEmptyList</code>. 
+    * </p>
+    */
+  def reduceRight[U >: T](op: (T, U) => U): U = toList.reduceRight(op)
+
+  /**
+    * Applies a binary operator to all elements of this <code>NonEmptyList</code>, going right to left, returning the result in a <code>Some</code>.
+    *
+    * @tparam U the result of the binary operator
+    * @param op the binary operator
+    * @return a <code>Some</code> containing the result of <code>reduceRight(op)</code>
+    */
+  def reduceRightOption[U >: T](op: (T, U) => U): Option[U] = toList.reduceRightOption(op)
+
+  /**
+    * Returns new <code>NonEmptyList</code> with elements in reverse order.
+    *
+    * @return a new <code>NonEmptyList</code> with all elements of this <code>NonEmptyList</code> in reversed order. 
+    */
+  def reverse: NonEmptyList[T] =
+    new NonEmptyList(toList.reverse)
+
+  /**
+    * An iterator yielding elements in reverse order.
+    *
+    * <p>
+    * Note: <code>nonEmptyList.reverseIterator</code> is the same as <code>nonEmptyList.reverse.iterator</code>, but might be more efficient. 
+    * </p>
+    *
+    * @return an iterator yielding the elements of this <code>NonEmptyList</code> in reversed order 
+    */
+  def reverseIterator: Iterator[T] = toList.reverseIterator
+
+  /**
+    * Builds a new <code>NonEmptyList</code> by applying a function to all elements of this <code>NonEmptyList</code> and collecting the results in reverse order.
+    *
+    * <p>
+    * Note: <code>nonEmptyList.reverseMap(f)</code> is the same as <code>nonEmptyList.reverse.map(f)</code>, but might be more efficient. 
+    * </p>
+    *
+    * @tparam U the element type of the returned <code>NonEmptyList</code>.
+    * @param f the function to apply to each element. 
+    * @return a new <code>NonEmptyList</code> resulting from applying the given function <code>f</code> to each element of this <code>NonEmptyList</code>
+    *     and collecting the results in reverse order. 
+    */
+  def reverseMap[U](f: T => U): NonEmptyList[U] =
+    new NonEmptyList(toList.reverseIterator.map(f).toList)
+
+  /**
+    * Checks if the given <code>Iterable</code> contains the same elements in the same order as this <code>NonEmptyList</code>.
+    *
+    * @param that the <code>Iterable</code> with which to compare
+    * @return <code>true</code>, if both this <code>NonEmptyList</code> and the given <code>Iterable</code> contain the same elements
+    *     in the same order, <code>false</code> otherwise. 
+    */
+  def sameElements[U >: T](that: Iterable[U]): Boolean = toList.sameElements(that)
+
+  /**
+    * Checks if the given <code>Vector</code> contains the same elements in the same order as this <code>NonEmptyList</code>.
+    *
+    * @param that the <code>Vector</code> with which to compare
+    * @return <code>true</code>, if both this and the given <code>Vector</code> contain the same elements
+    *     in the same order, <code>false</code> otherwise. 
+    */
+  def sameElements[U >: T](that: Vector[U]): Boolean = toList.sameElements(that)
+
+  /**
+    * Checks if the given <code>NonEmptyList</code> contains the same elements in the same order as this <code>NonEmptyList</code>.
+    *
+    * @param that the <code>NonEmptyList</code> with which to compare
+    * @return <code>true</code>, if both this and the given <code>NonEmptyList</code> contain the same elements
+    *     in the same order, <code>false</code> otherwise. 
+    */
+  def sameElements[U >: T](that: NonEmptyList[U]): Boolean = toList.sameElements(that.toList)
+
+  /**
+    * Computes a prefix scan of the elements of this <code>NonEmptyList</code>.
+    *
+    * <p>
+    * Note: The neutral element z may be applied more than once. 
+    * </p>
+    *
+    * <p>
+    * Here are some examples:
+    * </p>
+    *
+    * <pre class="stHighlight">
+    * NonEmptyList(1, 2, 3).scan(0)(_ + _) == NonEmptyList(0, 1, 3, 6)
+    * NonEmptyList(1, 2, 3).scan("z")(_ + _.toString) == NonEmptyList("z", "z1", "z12", "z123")
+    * </pre>
+    *
+    * @tparam U a type parameter for the binary operator, a supertype of T, and the type of the resulting <code>NonEmptyList</code>.
+    * @param z a neutral element for the scan operation; may be added to the result an arbitrary number of
+    *     times, and must not change the result (<em>e.g.</em>, <code>Nil</code> for list concatenation,
+    *     0 for addition, or 1 for multiplication.)
+    * @param op a binary operator that must be associative
+    * @return a new <code>NonEmptyList</code> containing the prefix scan of the elements in this <code>NonEmptyList</code> 
+    */
+  def scan[U >: T](z: U)(op: (U, U) => U): NonEmptyList[U] = new NonEmptyList(toList.scan(z)(op))
+
+  /**
+    * Produces a <code>NonEmptyList</code> containing cumulative results of applying the operator going left to right.
+    *
+    * <p>
+    * Here are some examples:
+    * </p>
+    *
+    * <pre class="stHighlight">
+    * NonEmptyList(1, 2, 3).scanLeft(0)(_ + _) == NonEmptyList(0, 1, 3, 6)
+    * NonEmptyList(1, 2, 3).scanLeft("z")(_ + _) == NonEmptyList("z", "z1", "z12", "z123")
+    * </pre>
+    *
+    * @tparam B the result type of the binary operator and type of the resulting <code>NonEmptyList</code>
+    * @param z the start value.
+    * @param op the binary operator.
+    * @return a new <code>NonEmptyList</code> containing the intermediate results of inserting <code>op</code> between consecutive elements of this <code>NonEmptyList</code>,
+    *     going left to right, with the start value, <code>z</code>, on the left.
+    */
+  def scanLeft[B](z: B)(op: (B, T) => B): NonEmptyList[B] = new NonEmptyList(toList.scanLeft(z)(op))
+
+  /**
+    * Produces a <code>NonEmptyList</code> containing cumulative results of applying the operator going right to left.
+    *
+    * <p>
+    * Here are some examples:
+    * </p>
+    *
+    * <pre class="stHighlight">
+    * NonEmptyList(1, 2, 3).scanRight(0)(_ + _) == NonEmptyList(6, 5, 3, 0)
+    * NonEmptyList(1, 2, 3).scanRight("z")(_ + _) == NonEmptyList("123z", "23z", "3z", "z")
+    * </pre>
+    *
+    * @tparam B the result of the binary operator and type of the resulting <code>NonEmptyList</code>
+    * @param z the start value
+    * @param op the binary operator
+    * @return a new <code>NonEmptyList</code> containing the intermediate results of inserting <code>op</code> between consecutive elements of this <code>NonEmptyList</code>,
+    *     going right to left, with the start value, <code>z</code>, on the right.
+    */
+  def scanRight[B](z: B)(op: (T, B) => B): NonEmptyList[B] = new NonEmptyList(toList.scanRight(z)(op))
+
+  /**
+    * Computes length of longest segment whose elements all satisfy some predicate.
+    *
+    * @param p the predicate used to test elements.
+    * @param from the index where the search starts.
+    * @param the length of the longest segment of this <code>NonEmptyList</code> starting from index <code>from</code> such that every element of the
+    *     segment satisfies the predicate <code>p</code>. 
+    */
+  def segmentLength(p: T => Boolean, from: Int): Int = toList.segmentLength(p, from)
+
+  /**
+    * Groups elements in fixed size blocks by passing a &ldquo;sliding window&rdquo; over them (as opposed to partitioning them, as is done in grouped.)
+    *
+    * @param size the number of elements per group
+    * @return an iterator producing <code>NonEmptyList</code>s of size <code>size</code>, except the last and the only element will be truncated
+    *     if there are fewer elements than <code>size</code>.
+    */
+  def sliding(size: Int): Iterator[NonEmptyList[T]] = toList.sliding(size).map(new NonEmptyList(_))
+
+  /**
+    * Groups elements in fixed size blocks by passing a &ldquo;sliding window&rdquo; over them (as opposed to partitioning them, as is done in grouped.),
+    * moving the sliding window by a given <code>step</code> each time.
+    *
+    * @param size the number of elements per group
+    * @param step the distance between the first elements of successive groups
+    * @return an iterator producing <code>NonEmptyList</code>s of size <code>size</code>, except the last and the only element will be truncated
+    *     if there are fewer elements than <code>size</code>.
+    */
+  def sliding(size: Int, step: Int): Iterator[NonEmptyList[T]] = toList.sliding(size, step).map(new NonEmptyList(_))
+
+  /**
+    * The size of this <code>NonEmptyList</code>.
+    *
+    * <p>
+    * Note: <code>length</code> and <code>size</code> yield the same result, which will be <code>&gt;</code>= 1. 
+    * </p>
+    *
+    * @return the number of elements in this <code>NonEmptyList</code>. 
+    */
+  def size: Int = toList.size
+
+  /**
+    * Sorts this <code>NonEmptyList</code> according to the <code>Ordering</code> of the result of applying the given function to every element.
+    *
+    * @tparam U the target type of the transformation <code>f</code>, and the type where the <code>Ordering</code> <code>ord</code> is defined.
+    * @param f the transformation function mapping elements to some other domain <code>U</code>.
+    * @param ord the ordering assumed on domain <code>U</code>.
+    * @return a <code>NonEmptyList</code> consisting of the elements of this <code>NonEmptyList</code> sorted according to the <code>Ordering</code> where
+    *    <code>x &lt; y if ord.lt(f(x), f(y))</code>. 
+    */
+  def sortBy[U](f: T => U)(implicit ord: Ordering[U]): NonEmptyList[T] = new NonEmptyList(toList.sortBy(f))
+
+  /**
+    * Sorts this <code>NonEmptyList</code> according to a comparison function.
+    *
+    * <p>
+    * The sort is stable. That is, elements that are equal (as determined by <code>lt</code>) appear in the same order in the
+    * sorted <code>NonEmptyList</code> as in the original. 
+    * </p>
+    *
+    * @param the comparison function that tests whether its first argument precedes its second argument in the desired ordering.
+    * @return a <code>NonEmptyList</code> consisting of the elements of this <code>NonEmptyList</code> sorted according to the comparison function <code>lt</code>.
+    */
+  def sortWith(lt: (T, T) => Boolean): NonEmptyList[T] = new NonEmptyList(toList.sortWith(lt))
+
+  /**
+    * Sorts this <code>NonEmptyList</code> according to an <code>Ordering</code>.
+    *
+    * <p>
+    * The sort is stable. That is, elements that are equal (as determined by <code>lt</code>) appear in the same order in the
+    * sorted <code>NonEmptyList</code> as in the original. 
+    * </p>
+    *
+    * @param ord the <code>Ordering</code> to be used to compare elements.
+    * @param the comparison function that tests whether its first argument precedes its second argument in the desired ordering.
+    * @return a <code>NonEmptyList</code> consisting of the elements of this <code>NonEmptyList</code> sorted according to the comparison function <code>lt</code>.
+    */
+  def sorted[U >: T](implicit ord: Ordering[U]): NonEmptyList[U] = new NonEmptyList(toList.sorted(ord))
+
+  /**
+    * Indicates whether this <code>NonEmptyList</code> starts with the given <code>Seq</code>. 
+    *
+    * @param that the <code>Seq</code> slice to look for in this <code>NonEmptyList</code>
+    * @return <code>true</code> if this <code>NonEmptyList</code> has <code>that</code> as a prefix, <code>false</code> otherwise.
+    */
+  def startsWith[B](that: Seq[B]): Boolean = toList.startsWith[Any](that)
+
+  /**
+    * Indicates whether this <code>NonEmptyList</code> starts with the given <code>Seq</code> at the given index. 
+    *
+    * @param that the <code>Seq</code> slice to look for in this <code>NonEmptyList</code>
+    * @param offset the index at which this <code>NonEmptyList</code> is searched.
+    * @return <code>true</code> if this <code>NonEmptyList</code> has <code>that</code> as a slice at the index <code>offset</code>, <code>false</code> otherwise.
+    */
+  def startsWith[B](that: Seq[B], offset: Int): Boolean = toList.startsWith[Any](that, offset)
+
+  /**
+    * Indicates whether this <code>NonEmptyList</code> starts with the given <code>Vector</code>. 
+    *
+    * @param that the <code>Vector</code> to test
+    * @return <code>true</code> if this collection has <code>that</code> as a prefix, <code>false</code> otherwise.
+    */
+  def startsWith[B](that: Vector[B]): Boolean = toList.startsWith[Any](that)
+
+  /**
+    * Indicates whether this <code>NonEmptyList</code> starts with the given <code>NonEmptyList</code>. 
+    *
+    * @param that the <code>NonEmptyList</code> to test
+    * @return <code>true</code> if this collection has <code>that</code> as a prefix, <code>false</code> otherwise.
+    */
+  def startsWith[B](that: NonEmptyList[B]): Boolean = toList.startsWith[Any](that.toList)
+
+  /**
+    * Indicates whether this <code>NonEmptyList</code> starts with the given <code>Vector</code> at the given index. 
+    *
+    * @param that the <code>Vector</code> slice to look for in this <code>NonEmptyList</code>
+    * @param offset the index at which this <code>NonEmptyList</code> is searched.
+    * @return <code>true</code> if this <code>NonEmptyList</code> has <code>that</code> as a slice at the index <code>offset</code>, <code>false</code> otherwise.
+    */
+  def startsWith[B](that: Vector[B], offset: Int): Boolean = toList.startsWith[Any](that, offset)
+
+  /**
+    * Indicates whether this <code>NonEmptyList</code> starts with the given <code>NonEmptyList</code> at the given index. 
+    *
+    * @param that the <code>NonEmptyList</code> slice to look for in this <code>NonEmptyList</code>
+    * @param offset the index at which this <code>NonEmptyList</code> is searched.
+    * @return <code>true</code> if this <code>NonEmptyList</code> has <code>that</code> as a slice at the index <code>offset</code>, <code>false</code> otherwise.
+    */
+  def startsWith[B](that: NonEmptyList[B], offset: Int): Boolean = toList.startsWith[Any](that.toList, offset)
+
+  /**
+    * Returns <code>"NonEmptyList"</code>, the prefix of this object's <code>toString</code> representation.
+    *
+    * @return the string <code>"NonEmptyList"</code>
+    */
+  def stringPrefix: String = "NonEmptyList"
+
+  /**
+    * The result of summing all the elements of this <code>NonEmptyList</code>.
+    *
+    * <p>
+    * This method can be invoked for any <code>NonEmptyList[T]</code> for which an implicit <code>Numeric[T]</code> exists.
+    * </p>
+    *
+    * @return the sum of all elements
+    */
+  def sum[U >: T](implicit num: Numeric[U]): U = toList.sum(num)
+
+  //import scala.collection.compat._
+
+  /**
+    * Converts this <code>NonEmptyList</code> into a collection of type <code>Col</code> by copying all elements.
+    *
+    * @tparam C1 the collection type to build.
+    * @return a new collection containing all elements of this <code>NonEmptyList</code>. 
+    */
+  def to[C1](factory: Factory[T, C1]): C1 = factory.fromSpecific(iterator)
+
+  /**
+    * Converts this <code>NonEmptyList</code> to an array.
+    *
+    * @return an array containing all elements of this <code>NonEmptyList</code>. A <code>ClassTag</code> must be available for the element type of this <code>NonEmptyList</code>. 
+    */
+  def toArray[U >: T](implicit classTag: ClassTag[U]): Array[U] = toList.toArray
+
+  /**
+    * Converts this <code>NonEmptyList</code> to a <code>Vector</code>.
+    *
+    * @return a <code>Vector</code> containing all elements of this <code>NonEmptyList</code>. 
+    */
+  def toVector: Vector[T] = toList.toVector
+
+  /**
+    * Converts this <code>NonEmptyList</code> to a mutable buffer.
+    *
+    * @return a buffer containing all elements of this <code>NonEmptyList</code>. 
+    */
+  def toBuffer[U >: T]: mutable.Buffer[U] = toList.toBuffer
+
+  /**
+    * Converts this <code>NonEmptyList</code> to an immutable <code>IndexedSeq</code>.
+    *
+    * @return an immutable <code>IndexedSeq</code> containing all elements of this <code>NonEmptyList</code>. 
+    */
+  def toIndexedSeq: collection.immutable.IndexedSeq[T] = toList.toVector
+
+  /**
+    * Converts this <code>NonEmptyList</code> to an iterable collection.
+    *
+    * @return an <code>Iterable</code> containing all elements of this <code>NonEmptyList</code>. 
+    */
+  def toIterable: Iterable[T] = toList
+
+  /**
+    * Returns an <code>Iterator</code> over the elements in this <code>NonEmptyList</code>.
+    *
+    * @return an <code>Iterator</code> containing all elements of this <code>NonEmptyList</code>. 
+    */
+  def toIterator: Iterator[T] = toList.iterator
+
+  /**
+    * Converts this <code>NonEmptyList</code> to a list.
+    *
+    * @return a list containing all elements of this <code>NonEmptyList</code>. 
+    */
+  // def toList: List[T] = toList
+
+  /**
+    * Converts this <code>NonEmptyList</code> to a map.
+    *
+    * <p>
+    * This method is unavailable unless the elements are members of <code>Tuple2</code>, each <code>((K, V))</code> becoming a key-value pair
+    * in the map. Duplicate keys will be overwritten by later keys.
+    * </p>
+    *
+    * @return a map of type <code>immutable.Map[K, V]</code> containing all key/value pairs of type <code>(K, V)</code> of this <code>NonEmptyList</code>. 
+    */
+  def toMap[K, V](implicit ev: T <:< (K, V)): Map[K, V] = toList.toMap
+
+  /**
+    * Converts this <code>NonEmptyList</code> to an immutable <code>IndexedSeq</code>.
+    *
+    * @return an immutable <code>IndexedSeq</code> containing all elements of this <code>NonEmptyList</code>.
+    */
+  def toSeq: collection.immutable.Seq[T] = toList
+
+  /**
+    * Converts this <code>NonEmptyList</code> to a set.
+    *
+    * @return a set containing all elements of this <code>NonEmptyList</code>. 
+    */
+  def toSet[U >: T]: Set[U] = toList.toSet
+
+  /**
+    * Returns a string representation of this <code>NonEmptyList</code>.
+    *
+    * @return the string <code>"NonEmptyList"</code> followed by the result of invoking <code>toString</code> on
+    *   this <code>NonEmptyList</code>'s elements, surrounded by parentheses.
+    */
+  override def toString: String = "NonEmptyList(" + toList.mkString(", ") + ")"
+
+  def transpose[U](implicit ev: T <:< NonEmptyList[U]): NonEmptyList[NonEmptyList[U]] = {
+    val asLists = toList.map(ev)
+    val list = asLists.map(_.toList).transpose
+    new NonEmptyList(list.map(new NonEmptyList(_)))
+  }
+
+  /**
+    * Produces a new <code>NonEmptyList</code> that contains all elements of this <code>NonEmptyList</code> and also all elements of a given <code>Vector</code>.
+    *
+    * <p>
+    * <code>nonEmptyListX</code> <code>union</code> <code>everyY</code> is equivalent to <code>nonEmptyListX</code> <code>++</code> <code>everyY</code>.
+    * </p>
+    *
+    * <p>
+    * Another way to express this is that <code>nonEmptyListX</code> <code>union</code> <code>everyY</code> computes the order-presevring multi-set union
+    * of <code>nonEmptyListX</code> and <code>everyY</code>. This <code>union</code> method is hence a counter-part of <code>diff</code> and <code>intersect</code> that
+    * also work on multi-sets.
+    * </p>
+    *
+    * @param that the <code>Vector</code> to add.
+    * @return a new <code>NonEmptyList</code> that contains all elements of this <code>NonEmptyList</code> followed by all elements of <code>that</code> <code>Vector</code>.
+    */
+  def union[U >: T](that: Vector[U]): NonEmptyList[U] = new NonEmptyList(toList ++ that)
+
+  /**
+    * Produces a new <code>NonEmptyList</code> that contains all elements of this <code>NonEmptyList</code> and also all elements of a given <code>NonEmptyList</code>.
+    *
+    * <p>
+    * <code>nonEmptyListX</code> <code>union</code> <code>nonEmptyListY</code> is equivalent to <code>nonEmptyListX</code> <code>++</code> <code>nonEmptyListY</code>.
+    * </p>
+    *
+    * <p>
+    * Another way to express this is that <code>nonEmptyListX</code> <code>union</code> <code>nonEmptyListY</code> computes the order-presevring multi-set union
+    * of <code>nonEmptyListX</code> and <code>nonEmptyListY</code>. This <code>union</code> method is hence a counter-part of <code>diff</code> and <code>intersect</code> that
+    * also work on multi-sets.
+    * </p>
+    *
+    * @param that the <code>NonEmptyList</code> to add.
+    * @return a new <code>NonEmptyList</code> that contains all elements of this <code>NonEmptyList</code> followed by all elements of <code>that</code>.
+    */
+  def union[U >: T](that: NonEmptyList[U]): NonEmptyList[U] = new NonEmptyList(toList ++ that.toList)
+
+  /**
+    * Produces a new <code>NonEmptyList</code> that contains all elements of this <code>NonEmptyList</code> and also all elements of a given <code>Seq</code>.
+    *
+    * <p>
+    * <code>nonEmptyListX</code> <code>union</code> <code>ys</code> is equivalent to <code>nonEmptyListX</code> <code>++</code> <code>ys</code>.
+    * </p>
+    *
+    * <p>
+    * Another way to express this is that <code>nonEmptyListX</code> <code>union</code> <code>ys</code> computes the order-presevring multi-set union
+    * of <code>nonEmptyListX</code> and <code>ys</code>. This <code>union</code> method is hence a counter-part of <code>diff</code> and <code>intersect</code> that
+    * also work on multi-sets.
+    * </p>
+    *
+    * @param that the <code>Seq</code> to add.
+    * @return a new <code>NonEmptyList</code> that contains all elements of this <code>NonEmptyList</code> followed by all elements of <code>that</code> <code>Seq</code>.
+    */
+  def union[U >: T](that: Seq[U]): NonEmptyList[U] = new NonEmptyList(toList ++ that)
+
+  /**
+    * Converts this <code>NonEmptyList</code> of pairs into two <code>NonEmptyList</code>s of the first and second half of each pair. 
+    *
+    * @tparam L the type of the first half of the element pairs
+    * @tparam R the type of the second half of the element pairs
+    * @param asPair an implicit conversion that asserts that the element type of this <code>NonEmptyList</code> is a pair.
+    * @return a pair of <code>NonEmptyList</code>s, containing the first and second half, respectively, of each element pair of this <code>NonEmptyList</code>. 
+    */
+  def unzip[L, R](implicit asPair: T => (L, R)): (NonEmptyList[L], NonEmptyList[R]) = {
+    val unzipped = toList.unzip
+    (new NonEmptyList(unzipped._1), new NonEmptyList(unzipped._2))
+  }
+
+  /**
+    * Converts this <code>NonEmptyList</code> of triples into three <code>NonEmptyList</code>s of the first, second, and and third element of each triple. 
+    *
+    * @tparam L the type of the first member of the element triples
+    * @tparam R the type of the second member of the element triples
+    * @tparam R the type of the third member of the element triples
+    * @param asTriple an implicit conversion that asserts that the element type of this <code>NonEmptyList</code> is a triple.
+    * @return a triple of <code>NonEmptyList</code>s, containing the first, second, and third member, respectively, of each element triple of this <code>NonEmptyList</code>. 
+    */
+  def unzip3[L, M, R](implicit asTriple: T => (L, M, R)): (NonEmptyList[L], NonEmptyList[M], NonEmptyList[R]) = {
+    val unzipped = toList.unzip3
+    (new NonEmptyList(unzipped._1), new NonEmptyList(unzipped._2), new NonEmptyList(unzipped._3))
+  }
+
+  /**
+    * A copy of this <code>NonEmptyList</code> with one single replaced element.
+    *
+    * @param idx the position of the replacement
+    * @param elem the replacing element
+    * @throws IndexOutOfBoundsException if the passed index is greater than or equal to the length of this <code>NonEmptyList</code>
+    * @return a copy of this <code>NonEmptyList</code> with the element at position <code>idx</code> replaced by <code>elem</code>. 
+    */
+  def updated[U >: T](idx: Int, elem: U): NonEmptyList[U] =
+    try new NonEmptyList(toList.updated(idx, elem))
+    catch { case _: UnsupportedOperationException => throw new IndexOutOfBoundsException(idx.toString) } // This is needed for 2.10 support. Can drop after.
+  // Because 2.11 throws IndexOutOfBoundsException.
+
+  /**
+    * Returns a <code>NonEmptyList</code> formed from this <code>NonEmptyList</code> and an iterable collection by combining corresponding
+    * elements in pairs. If one of the two collections is shorter than the other, placeholder elements will be used to extend the
+    * shorter collection to the length of the longer.
+    *
+    * @tparm O the type of the second half of the returned pairs
+    * @tparm U the type of the first half of the returned pairs
+    * @param other the <code>Iterable</code> providing the second half of each result pair
+    * @param thisElem the element to be used to fill up the result if this <code>NonEmptyList</code> is shorter than <code>that</code> <code>Iterable</code>.
+    * @param thatElem the element to be used to fill up the result if <code>that</code> <code>Iterable</code> is shorter than this <code>NonEmptyList</code>.
+    * @return a new <code>NonEmptyList</code> containing pairs consisting of corresponding elements of this <code>NonEmptyList</code> and <code>that</code>. The
+    *     length of the returned collection is the maximum of the lengths of this <code>NonEmptyList</code> and <code>that</code>. If this <code>NonEmptyList</code>
+    *     is shorter than <code>that</code>, <code>thisElem</code> values are used to pad the result. If <code>that</code> is shorter than this
+    *     <code>NonEmptyList</code>, <code>thatElem</code> values are used to pad the result. 
+    */
+  def zipAll[O, U >: T](other: collection.Iterable[O], thisElem: U, otherElem: O): NonEmptyList[(U, O)] =
+    new NonEmptyList(toList.zipAll(other, thisElem, otherElem))
+
+  /**
+    * Zips this <code>NonEmptyList</code>  with its indices.
+    *
+    * @return A new <code>NonEmptyList</code> containing pairs consisting of all elements of this <code>NonEmptyList</code> paired with their index. Indices start at 0.
+    */
+  def zipWithIndex: NonEmptyList[(T, Int)] = new NonEmptyList(toList.zipWithIndex)
+}
+
+/**
+  * Companion object for class <code>NonEmptyList</code>.
+  */
+object NonEmptyList {
+
+  /**
+    * Constructs a new <code>NonEmptyList</code> given at least one element.
+    *
+    * @tparam T the type of the element contained in the new <code>NonEmptyList</code>
+    * @param firstElement the first element (with index 0) contained in this <code>NonEmptyList</code>
+    * @param otherElements a varargs of zero or more other elements (with index 1, 2, 3, ...) contained in this <code>NonEmptyList</code>
+    */
+  def apply[T](firstElement: T, otherElements: T*): NonEmptyList[T] = new NonEmptyList(firstElement :: otherElements.toList)
+
+  /**
+    * Variable argument extractor for <code>NonEmptyList</code>s.
+    *
+    * @param nonEmptyList: the <code>NonEmptyList</code> containing the elements to extract
+    * @return an <code>Seq</code> containing this <code>NonEmptyList</code>s elements, wrapped in a <code>Some</code> 
+    */
+  def unapplySeq[T](nonEmptyList: NonEmptyList[T]): Option[Seq[T]] = Some(nonEmptyList.toList)
+
+  /*
+    // TODO: Figure out how to get case NonEmptyList() to not compile
+    def unapplySeq[T](nonEmptyList: NonEmptyList[T]): Option[(T, Seq[T])] = Some(nonEmptyList.head, nonEmptyList.tail)
+  */
+
+  /**
+    * Optionally construct a <code>NonEmptyList</code> containing the elements, if any, of a given <code>Seq</code>.
+    *
+    * @param seq the <code>Seq</code> with which to construct a <code>NonEmptyList</code>
+    * @return a <code>NonEmptyList</code> containing the elements of the given <code>Seq</code>, if non-empty, wrapped in
+    *     a <code>Some</code>; else <code>None</code> if the <code>Seq</code> is empty
+    */
+  def from[T](seq: Seq[T]): Option[NonEmptyList[T]] =
+    seq.headOption match {
+      case None => None
+      case Some(first) => Some(new NonEmptyList(first :: seq.tail.toList))
+    }
+}
diff --git a/fundamentals/fundamentals-collections/src/main/scala/izumi/fundamentals/collections/nonempty/NonEmptyMap.scala b/fundamentals/fundamentals-collections/src/main/scala/izumi/fundamentals/collections/nonempty/NonEmptyMap.scala
new file mode 100644
index 000000000..4594162fb
--- /dev/null
+++ b/fundamentals/fundamentals-collections/src/main/scala/izumi/fundamentals/collections/nonempty/NonEmptyMap.scala
@@ -0,0 +1,893 @@
+package izumi.fundamentals.collections.nonempty
+
+
+
+import scala.collection.{Iterable, Seq, mutable}
+import scala.collection.mutable.{ArrayBuffer, Buffer}
+import scala.reflect.ClassTag
+import scala.collection.compat._
+
+// Can't be a LinearSeq[T] because Builder would be able to create an empty one.
+/**
+  * A non-empty map: an ordered, immutable, non-empty collection of key-value tuples with <code>LinearSeq</code> performance characteristics.
+  *
+  * <p>
+  * The purpose of <code>NonEmptyMap</code> is to allow you to express in a type that a <code>Map</code> is non-empty, thereby eliminating the
+  * need for (and potential exception from) a run-time check for non-emptiness. For a non-empty sequence with <code>IndexedSeq</code>
+  * performance, see <a href="Vector.html"><code>Vector</code></a>.
+  * </p>
+  *
+  * <h2>Constructing <code>NonEmptyMap</code>s</h2>
+  *
+  * <p>
+  * You can construct a <code>NonEmptyMap</code> by passing one or more elements to the <code>NonEmptyMap.apply</code> factory method:
+  * </p>
+  *
+  * <pre class="stHighlight">
+  * scala&gt; NonEmptyMap(1 -> "one", 2 -> "two", 3 -> "three")
+  * res0: org.scalactic.anyvals.NonEmptyMap[Int, String] = NonEmptyMap(1 -> "one", 2 -> "two", 3 -> "three")
+  * </pre>
+  *
+  * <h2>Working with <code>NonEmptyMap</code>s</h2>
+  *
+  * <p>
+  * <code>NonEmptyMap</code> does not extend Scala's <code>Map</code> or <code>Traversable</code> traits because these require that
+  * implementations may be empty. For example, if you invoke <code>tail</code> on a <code>Seq</code> that contains just one element,
+  * you'll get an empty <code>Seq</code>:
+  * </p>
+  *
+  * <pre class="stREPL">
+  * scala&gt; Map(1 -> "one").tail
+  * res6: Map[Int] = Map()
+  * </pre>
+  *
+  * <p>
+  * On the other hand, many useful methods exist on <code>Map</code> that when invoked on a non-empty <code>Seq</code> are guaranteed
+  * to not result in an empty <code>Map</code>. For convenience, <code>NonEmptyMap</code> defines a method corresponding to every such <code>Map</code>
+  * method. Here are an example:
+  * </p>
+  *
+  * <pre class="stHighlight">
+  * NonEmptyMap(1 -> "one", 2 -> "two", 3 -> "three").map(t => (t._1 + 1, t._2))                        // Result: NonEmptyMap(2 -> "one", 3 -> "two", 4 -> "three")
+  * </pre>
+  *
+  * <p>
+  * <code>NonEmptyMap</code> does <em>not</em> currently define any methods corresponding to <code>Map</code> methods that could result in
+  * an empty <code>Map</code>. However, an implicit converison from <code>NonEmptyMap</code> to <code>Map</code>
+  * is defined in the <code>NonEmptyMap</code> companion object that will be applied if you attempt to call one of the missing methods. As a
+  * result, you can invoke <code>filter</code> on an <code>NonEmptyMap</code>, even though <code>filter</code> could result
+  * in an empty map&mdash;but the result type will be <code>Map</code> instead of <code>NonEmptyMap</code>:
+  * </p>
+  *
+  * <pre class="stHighlight">
+  * NonEmptyMap(1 -> "one", 2 -> "two", 3 -> "three").filter(_._1 &lt; 10) // Result: Map(1 -> "one", 2 -> "two", 3 -> "three")
+  * NonEmptyMap(1 -> "one", 2 -> "two", 3 -> "three").filter(_._ 1&gt; 10) // Result: Map()
+  * </pre>
+  *
+  *
+  * <p>
+  * You can use <code>NonEmptyMap</code>s in <code>for</code> expressions. The result will be an <code>NonEmptyMap</code> unless
+  * you use a filter (an <code>if</code> clause). Because filters are desugared to invocations of <code>filter</code>, the
+  * result type will switch to a <code>Map</code> at that point. Here are some examples:
+  * </p>
+  *
+  * <pre class="stREPL">
+  * scala&gt; import org.scalactic.anyvals._
+  * import org.scalactic.anyvals._
+  *
+  * scala&gt; for ((i, j) &lt;- NonEmptyMap(1 -> "one", 2 -> "two", 3 -> "three")) yield (i + 1, j)
+  * res0: org.scalactic.anyvals.NonEmptyMap[Int, String] = NonEmptyMap(2 -> "one", 3 -> "two", 4 -> "three")
+  *
+  * scala&gt; for ((i, j) &lt;- NonEmptyMap(1, 2, 3) if i &lt; 10) yield (i + 1, j)
+  * res1: Map[Int, String] = Map(2 -> "one", 3 -> "two", 4 -> "three")
+  * </pre>
+  *
+  * @tparam K the type of key contained in this <code>NonEmptyMap</code>
+  * @tparam V the type of value contained in this <code>NonEmptyMap</code>
+  */
+final class NonEmptyMap[K, +V] private (val toMap: Map[K, V]) extends AnyVal {
+
+  /**
+    * Returns a new <code>NonEmptyMap</code> containing the entries of this <code>NonEmptyMap</code> and the entries of the passed <code>NonEmptyMap</code>.
+    * The entry type of the resulting <code>NonEmptyMap</code> is the most specific superclass encompassing the entry types of this and the passed <code>NonEmptyMap</code>.
+    *
+    * @tparam V1 the value type of the returned <code>NonEmptyMap</code>
+    * @param other the <code>NonEmptyMap</code> to append
+    * @return a new <code>NonEmptyMap</code> that contains all the elements of this <code>NonEmptyMap</code> and all elements of <code>other</code>.
+    */
+  def ++[V1 >: V](other: NonEmptyMap[K, V1]): NonEmptyMap[K, V1] = new NonEmptyMap(toMap ++ other.toMap)
+
+  /**
+    * Returns a new <code>NonEmptyMap</code> containing the entries of this <code>NonEmptyMap</code> and the entries of the passed <code>Vector</code>.
+    * The entry type of the resulting <code>NonEmptyMap</code> is the most specific superclass encompassing the entry types of this <code>NonEmptyMap</code> and the passed <code>Vector</code>.
+    *
+    * @tparam V1 the value type of the returned <code>NonEmptyMap</code>
+    * @param other the <code>Vector</code> to append
+    * @return a new <code>NonEmptyMap</code> that contains all the entries of this <code>NonEmptyMap</code> and all elements of <code>other</code>.
+    */
+  def ++[V1 >: V](other: Vector[(K, V1)]): NonEmptyMap[K, V1] = new NonEmptyMap(toMap ++ other.toVector)
+
+  // TODO: Have I added these extra ++, etc. methods to Vector that take a NonEmptyMap?
+
+  /**
+    * Returns a new <code>NonEmptyMap</code> containing the entries of this <code>NonEmptyMap</code> and the entries of the passed <code>TraversableOnce</code>.
+    * The entry type of the resulting <code>NonEmptyMap</code> is the most specific superclass encompassing the entry types of this <code>NonEmptyMap</code>
+    * and the passed <code>TraversableOnce</code>.
+    *
+    * @tparam V1 the value type of the returned <code>NonEmptyMap</code>
+    * @param other the <code>TraversableOnce</code> to append
+    * @return a new <code>NonEmptyMap</code> that contains all the elements of this <code>NonEmptyMap</code> followed by all elements of <code>other</code>.
+    */
+  def ++[V1 >: V](other: IterableOnce[(K, V1)]): NonEmptyMap[K, V1] =
+    if (other.iterator.isEmpty) this else new NonEmptyMap(toMap ++ other.iterator.toMap)
+
+  /**
+    * Returns a new <code>NonEmptyMap</code> with the given entry added.
+    *
+    * <p>
+    * Note that :-ending operators are right associative. A mnemonic for <code>+:</code> <em>vs.</em> <code>:+</code> is: the COLon goes on the COLlection side.
+    * </p>
+    *
+    * @param entry the element to add to this <code>NonEmptyMap</code>
+    * @return a new <code>NonEmptyMap</code> consisting of <code>element</code> followed by all elements of this <code>NonEmptyMap</code>.
+    */
+  def +:[V1 >: V](entry: (K, V1)): NonEmptyMap[K, V1] = new NonEmptyMap(toMap + entry)
+
+  /**
+    * As with <code>++</code>, returns a new <code>NonEmptyMap</code> containing the entries of this <code>NonEmptyMap</code> and the entries of the passed <code>NonEmptyMap</code>.
+    * The entry type of the resulting <code>NonEmptyMap</code> is the most specific superclass encompassing the entry types of this and the passed <code>NonEmptyMap</code>.
+    *
+    * It differs from <code>++</code> in that the right operand determines the type of the resulting collection rather than the left one. Mnemonic: the COLon is on the side of the new COLlection type.
+    *
+    * @tparam V1 the value type of the returned <code>NonEmptyMap</code>
+    * @param other the <code>NonEmptyMap</code> to add
+    * @return a new <code>NonEmptyMap</code> that contains all the elements of this <code>NonEmptyMap</code> and all elements of <code>other</code>.
+    */
+  def ++:[V1 >: V](other: NonEmptyMap[K, V1]): NonEmptyMap[K, V1] = new NonEmptyMap(toMap ++ other.toMap)
+
+  /**
+    * As with <code>++</code>, returns a new <code>NonEmptyMap</code> containing the entries of this <code>NonEmptyMap</code> and the entries of the passed <code>Vector</code>.
+    * The entry type of the resulting <code>NonEmptyMap</code> is the most specific superclass encompassing the entry types of this <code>NonEmptyMap</code> and the passed <code>Vector</code>.
+    *
+    * It differs from <code>++</code> in that the right operand determines the type of the resulting collection rather than the left one. Mnemonic: the COLon is on the side of the new COLlection type.
+    *
+    * @tparam V1 the value type of the returned <code>NonEmptyMap</code>
+    * @param other the <code>Vector</code> to append
+    * @return a new <code>NonEmptyMap</code> that contains all the entries of this <code>NonEmptyMap</code> and all elements of <code>other</code>.
+    */
+  def ++:[V1 >: V](other: Vector[(K, V1)]): NonEmptyMap[K, V1] = new NonEmptyMap(toMap ++ other.toVector)
+
+  /**
+    * Returns a new <code>NonEmptyMap</code> containing the entries of this <code>NonEmptyMap</code> and the entries of the passed <code>TraversableOnce</code>.
+    * The entry type of the resulting <code>NonEmptyMap</code> is the most specific superclass encompassing the entry types of this <code>NonEmptyMap</code>
+    * and the passed <code>TraversableOnce</code>.
+    *
+    * @tparam V1 the value type of the returned <code>NonEmptyMap</code>
+    * @param other the <code>TraversableOnce</code> to append
+    * @return a new <code>NonEmptyMap</code> that contains all the elements of this <code>NonEmptyMap</code> followed by all elements of <code>other</code>.
+    */
+  def ++:[V1 >: V](other: IterableOnce[(K, V1)]): NonEmptyMap[K, V1] =
+    if (other.iterator.isEmpty) this else new NonEmptyMap(toMap ++ other.iterator.toMap)
+
+  /**
+    * Returns a new <code>NonEmptyMap</code> with the given entry added.
+    *
+    * @param entry the entry to add to this <code>NonEmptyMap</code>
+    * @return a new <code>NonEmptyMap</code> consisting of all entries of this <code>NonEmptyMap</code> and <code>entry</code>.
+    */
+  def +[V1 >: V](entry: (K, V1)): NonEmptyMap[K, V1] = new NonEmptyMap(toMap + entry)
+
+  /**
+    * Returns a new <code>NonEmptyMap</code> with the given entries added.
+    *
+    * @param entries the entries to add to this <code>NonEmptyMap</code>
+    * @return a new <code>NonEmptyMap</code> consisting of all entries of this <code>NonEmptyMap</code> and <code>entries</code>.
+    */
+  def +[V1 >: V](entries: (K, V1)*): NonEmptyMap[K, V1] = new NonEmptyMap(toMap ++ entries)
+
+  /**
+    * Appends all entries of this <code>NonEmptyMap</code> to a string builder. The written text will consist of a concatenation of the result of invoking <code>toString</code>
+    * on of every entry of this <code>NonEmptyMap</code>, without any separator string.
+    *
+    * @param sb the string builder to which entries will be appended
+    * @return the string builder, <code>sb</code>, to which entries were appended.
+    */
+  def addString(sb: StringBuilder): StringBuilder = toMap.addString(sb)
+
+  /**
+    * Appends all entries of this <code>NonEmptyMap</code> to a string builder using a separator string. The written text will consist of a concatenation of the
+    * result of invoking <code>toString</code>
+    * on of every element of this <code>NonEmptyMap</code>, separated by the string <code>sep</code>.
+    *
+    * @param sb the string builder to which entries will be appended
+    * @param sep the separator string
+    * @return the string builder, <code>sb</code>, to which elements were appended.
+    */
+  def addString(sb: StringBuilder, sep: String): StringBuilder = toMap.addString(sb, sep)
+
+  /**
+    * Appends all entries of this <code>NonEmptyMap</code> to a string builder using start, end, and separator strings. The written text will consist of a concatenation of
+    * the string <code>start</code>; the result of invoking <code>toString</code> on all elements of this <code>NonEmptyMap</code>,
+    * separated by the string <code>sep</code>; and the string <code>end</code>
+    *
+    * @param sb the string builder to which elements will be appended
+    * @param start the starting string
+    * @param sep the separator string
+    * @param start the ending string
+    * @return the string builder, <code>sb</code>, to which elements were appended.
+    */
+  def addString(sb: StringBuilder, start: String, sep: String, end: String): StringBuilder = toMap.addString(sb, start, sep, end)
+
+  /**
+    * Selects an value by its key in the <code>NonEmptyMap</code>.
+    *
+    * @return the value of this <code>NonEmptyMap</code> at key <code>k</code>.
+    */
+  def apply(k: K): V = toMap(k)
+
+  /**
+    * Finds the first entry of this <code>NonEmptyMap</code> for which the given partial function is defined, if any, and applies the partial function to it.
+    *
+    * @param pf the partial function
+    * @return an <code>Option</code> containing <code>pf</code> applied to the first entry for which it is defined, or <code>None</code> if
+    *    the partial function was not defined for any entry.
+    */
+  def collectFirst[U](pf: PartialFunction[(K, V), U]): Option[U] = toMap.collectFirst(pf)
+
+  /**
+    * Indicates whether this <code>NonEmptyMap</code> contains a binding for given key.
+    *
+    * @param key the key to look for
+    * @return true if this <code>NonEmptyMap</code> has a binding that is equal (as determined by <code>==)</code> to <code>key</code>, false otherwise.
+    */
+  def contains(key: K): Boolean = toMap.contains(key)
+
+  /**
+    * Copies entries of this <code>NonEmptyMap</code> to an array. Fills the given array <code>arr</code> with entries of this <code>NonEmptyMap</code>. Copying
+    * will stop once either the end of the current <code>NonEmptyMap</code> is reached, or the end of the array is reached.
+    *
+    * @param arr the array to fill
+    */
+  def copyToArray[V1 >: V](arr: Array[(K, V1)]): Unit = {
+    toMap.copyToArray(arr)
+    ()
+  }
+
+  /**
+    * Copies entries of this <code>NonEmptyMap</code> to an array. Fills the given array <code>arr</code> with entries of this <code>NonEmptyMap</code>, beginning at
+    * index <code>start</code>. Copying will stop once either the end of the current <code>NonEmptyMap</code> is reached, or the end of the array is reached.
+    *
+    * @param arr the array to fill
+    * @param start the starting index
+    */
+  def copyToArray[V1 >: V](arr: Array[(K, V1)], start: Int): Unit = {
+    toMap.copyToArray(arr, start)
+    ()
+  }
+
+  /**
+    * Copies entries of this <code>NonEmptyMap</code> to an array. Fills the given array <code>arr</code> with at most <code>len</code> entries of this <code>NonEmptyMap</code>, beginning at
+    * index <code>start</code>. Copying will stop once either the end of the current <code>NonEmptyMap</code> is reached, the end of the array is reached, or
+    * <code>len</code> elements have been copied.
+    *
+    * @param arr the array to fill
+    * @param start the starting index
+    * @param len the maximum number of elements to copy
+    */
+  def copyToArray[V1 >: V](arr: Array[(K, V1)], start: Int, len: Int): Unit = {
+    toMap.copyToArray(arr, start, len)
+    ()
+  }
+
+  /**
+    * Copies all elements of this <code>NonEmptyMap</code> to a buffer. 
+    *
+    * @param buf the buffer to which elements are copied
+    */
+  def copyToBuffer[V1 >: V](buf: Buffer[(K, V1)]): Unit = {
+    buf ++= toMap
+    ()
+  }
+
+  /**
+    * Counts the number of elements in this <code>NonEmptyMap</code> that satisfy a predicate. 
+    *
+    * @param p the predicate used to test elements.
+    * @return the number of elements satisfying the predicate <code>p</code>. 
+    */
+  def count(p: ((K, V)) => Boolean): Int = toMap.count(p)
+
+  /*
+    override def equals(o: Any): Boolean =
+      o match {
+        case nonEmptyMap: NonEmptyMap[_] => toMap == nonEmptyMap.toMap
+        case _ => false
+      }
+  */
+
+  /**
+    * Indicates whether a predicate holds for at least one of the entries of this <code>NonEmptyMap</code>.
+    *
+    * @param p the predicate used to test entries.
+    * @return <code>true</code> if the given predicate <code>p</code> holds for some of the entries of this <code>NonEmptyMap</code>, otherwise <code>false</code>.
+    */
+  def exists(p: ((K, V)) => Boolean): Boolean = toMap.exists(p)
+
+  /**
+    * Finds the first entry of this <code>NonEmptyMap</code> that satisfies the given predicate, if any.
+    *
+    * @param p the predicate used to test elements
+    * @return an <code>Some</code> containing the first element in this <code>NonEmptyMap</code> that satisfies <code>p</code>, or <code>None</code> if none exists. 
+    */
+  def find(p: ((K, V)) => Boolean): Option[(K, V)] = toMap.find(p)
+
+  /**
+    * Builds a new <code>NonEmptyMap</code> by applying a function to all entries of this <code>NonEmptyMap</code> and using the entries of the resulting <code>NonEmptyMap</code>s.
+    *
+    * @tparam K1 the key type of the returned <code>NonEmptyMap</code>
+    * @tparam V1 the value type of the returned <code>NonEmptyMap</code>
+    * @param f the function to apply to each entry.
+    * @return a new <code>NonEmptyMap</code> containing entries obtained by applying the given function <code>f</code> to each entry of this <code>NonEmptyMap</code> and concatenating
+    *    the entries of resulting <code>NonEmptyMap</code>s.
+    */
+  def flatMap[K1, V1](f: ((K, V)) => NonEmptyMap[K1, V1]): NonEmptyMap[K1, V1] = {
+    val buf = new ArrayBuffer[(K1, V1)]
+    for (ele <- toMap)
+      buf ++= f(ele).toMap
+    new NonEmptyMap(buf.toMap)
+  }
+
+  /**
+    * Folds the entries of this <code>NonEmptyMap</code> using the specified associative binary operator.
+    *
+    * <p>
+    * The order in which operations are performed on entries is unspecified and may be nondeterministic.
+    * </p>
+    *
+    * @tparam U a type parameter for the binary operator, a supertype of (K, V).
+    * @param z a neutral element for the fold operation; may be added to the result an arbitrary number of
+    *     times, and must not change the result (<em>e.g.</em>, <code>Nil</code> for list concatenation,
+    *     0 for addition, or 1 for multiplication.)
+    * @param op a binary operator that must be associative
+    * @return the result of applying fold operator <code>op</code> between all the elements and <code>z</code>
+    */
+  def fold[U >: (K, V)](z: U)(op: (U, U) => U): U = toMap.fold(z)(op)
+
+  /**
+    * Applies a binary operator to a start value and all elements of this <code>NonEmptyMap</code>, going left to right.
+    *
+    * @tparam B the result type of the binary operator.
+    * @param z the start value.
+    * @param op the binary operator.
+    * @return the result of inserting <code>op</code> between consecutive entries of this <code>NonEmptyMap</code>, going left to right, with the start value,
+    *     <code>z</code>, on the left:
+    *
+    * <pre>
+    * op(...op(op(z, x_1), x_2), ..., x_n)
+    * </pre>
+    *
+    * <p>
+    * where x<sub>1</sub>, ..., x<sub>n</sub> are the elements of this <code>NonEmptyMap</code>. 
+    * </p>
+    */
+  def foldLeft[B](z: B)(op: (B, (K, V)) => B): B = toMap.foldLeft(z)(op)
+
+  /**
+    * Applies a binary operator to all entries of this <code>NonEmptyMap</code> and a start value, going right to left.
+    *
+    * @tparam B the result of the binary operator
+    * @param z the start value
+    * @param op the binary operator
+    * @return the result of inserting <code>op</code> between consecutive entries of this <code>NonEmptyMap</code>, going right to left, with the start value,
+    *     <code>z</code>, on the right:
+    *
+    * <pre>
+    * op(x_1, op(x_2, ... op(x_n, z)...))
+    * </pre>
+    *
+    * <p>
+    * where x<sub>1</sub>, ..., x<sub>n</sub> are the elements of this <code>NonEmptyMap</code>. 
+    * </p>
+    */
+  def foldRight[B](z: B)(op: ((K, V), B) => B): B = toMap.foldRight(z)(op)
+
+  /**
+    * Indicates whether a predicate holds for all entries of this <code>NonEmptyMap</code>.
+    *
+    * @param p the predicate used to test entries.
+    * @return <code>true</code> if the given predicate <code>p</code> holds for all entries of this <code>NonEmptyMap</code>, otherwise <code>false</code>.
+    */
+  def forall(p: ((K, V)) => Boolean): Boolean = toMap.forall(p)
+
+  /**
+    * Applies a function <code>f</code> to all entries of this <code>NonEmptyMap</code>.
+    *
+    * @param f the function that is applied for its side-effect to every entry. The result of function <code>f</code> is discarded.
+    */
+  def foreach(f: ((K, V)) => Unit): Unit = toMap.foreach(f)
+
+  /**
+    * Partitions this <code>NonEmptyMap</code> into a map of <code>NonEmptyMap</code>s according to some discriminator function.
+    *
+    * @param f the discriminator function.
+    * @return A map from keys to <code>NonEmptyMap</code>s such that the following invariant holds:
+    *
+    * <pre>
+    * (nonEmptyMap.toMap partition f)(k) = xs filter (x =&gt; f(x) == k)
+    * </pre>
+    *
+    * <p>
+    * That is, every key <code>k</code> is bound to a <code>NonEmptyMap</code> of those elements <code>x</code> for which <code>f(x)</code> equals <code>k</code>.
+    * </p>
+    */
+  def groupBy(f: ((K, V)) => K): Map[K, NonEmptyMap[K, V]] = {
+    val mapKToMap = toMap.groupBy(f)
+    mapKToMap.view.mapValues { list => new NonEmptyMap(list) }.toMap
+  }
+
+  /**
+    * Partitions entries into fixed size <code>NonEmptyMap</code>s.
+    *
+    * @param size the number of entries per group
+    * @return An iterator producing <code>NonEmptyMap</code>s of size <code>size</code>, except the last will be truncated if the entries don't divide evenly.
+    */
+  def grouped(size: Int): Iterator[NonEmptyMap[K, V]] = {
+    val itOfMap = toMap.grouped(size)
+    itOfMap.map { list => new NonEmptyMap(list) }
+  }
+
+  /**
+    * Returns <code>true</code> to indicate this <code>NonEmptyMap</code> has a definite size, since all <code>NonEmptyMap</code>s are strict collections.
+    */
+  def hasDefiniteSize: Boolean = true
+
+  // override def hashCode: Int = toMap.hashCode
+
+  /**
+    * Selects the first element of this <code>NonEmptyMap</code>. 
+    *
+    * @return the first element of this <code>NonEmptyMap</code>.
+    */
+  def head: (K, V) = toMap.head
+
+
+
+  /**
+    * Tests whether this <code>NonEmptyMap</code> contains given key.
+    *
+    * @param key the key to test
+    * @return true if this <code>NonEmptyMap</code> contains a binding for the given <code>key</code>, <code>false</code> otherwise.
+    */
+  def isDefinedAt(key: K): Boolean = toMap.isDefinedAt(key)
+
+  /**
+    * Returns <code>false</code> to indicate this <code>NonEmptyMap</code>, like all <code>NonEmptyMap</code>s, is non-empty.
+    *
+    * @return false
+    */
+  def isEmpty: Boolean = false
+
+  /**
+    * Returns <code>true</code> to indicate this <code>NonEmptyMap</code>, like all <code>NonEmptyMap</code>s, can be traversed repeatedly.
+    *
+    * @return true
+    */
+  def isTraversableAgain: Boolean = true
+
+  /**
+    * Creates and returns a new iterator over all elements contained in this <code>NonEmptyMap</code>.
+    *
+    * @return the new iterator
+    */
+  def iterator: Iterator[(K, V)] = toMap.iterator
+
+  /**
+    * Selects the last entry of this <code>NonEmptyMap</code>.
+    *
+    * @return the last entry of this <code>NonEmptyMap</code>.
+    */
+  def last: (K, V) = toMap.last
+
+  /**
+    * Builds a new <code>NonEmptyMap</code> by applying a function to all entries of this <code>NonEmptyMap</code>.
+    *
+    * @tparam K1 the key type of the returned <code>NonEmptyMap</code>.
+    * @tparam V1 the value type of the returned <code>NonEmptyMap</code>.
+    * @param f the function to apply to each element. 
+    * @return a new <code>NonEmptyMap</code> resulting from applying the given function <code>f</code> to each element of this <code>NonEmptyMap</code> and collecting the results. 
+    */
+  def map[K1, V1](f: ((K, V)) => (K1, V1)): NonEmptyMap[K1, V1] =
+    new NonEmptyMap(toMap.map(f))
+
+  /**
+    * Finds the largest entry.
+    *
+    * @return the largest entry of this <code>NonEmptyMap</code>.
+    */
+  def max[U >: (K, V)](implicit cmp: Ordering[U]): (K, V) = toMap.max(cmp)
+
+  /**
+    * Finds the largest result after applying the given function to every entry.
+    *
+    * @return the largest result of applying the given function to every entry of this <code>NonEmptyMap</code>.
+    */
+  def maxBy[U](f: ((K, V)) => U)(implicit cmp: Ordering[U]): (K, V) = toMap.maxBy(f)(cmp)
+
+  /**
+    * Finds the smallest entry.
+    *
+    * @return the smallest entry of this <code>NonEmptyMap</code>.
+    */
+  def min[U >: (K, V)](implicit cmp: Ordering[U]): (K, V) = toMap.min(cmp)
+
+  /**
+    * Finds the smallest result after applying the given function to every entry.
+    *
+    * @return the smallest result of applying the given function to every entry of this <code>NonEmptyMap</code>.
+    */
+  def minBy[U](f: ((K, V)) => U)(implicit cmp: Ordering[U]): (K, V) = toMap.minBy(f)(cmp)
+
+  /**
+    * Displays all entries of this <code>NonEmptyMap</code> in a string.
+    *
+    * @return a string representation of this <code>NonEmptyMap</code>. In the resulting string, the result of invoking <code>toString</code> on all entries of this
+    *     <code>NonEmptyMap</code> follow each other without any separator string. 
+    */
+  def mkString: String = toMap.mkString
+
+  /**
+    * Displays all entries of this <code>NonEmptyMap</code> in a string using a separator string.
+    *
+    * @param sep the separator string
+    * @return a string representation of this <code>NonEmptyMap</code>. In the resulting string, the result of invoking <code>toString</code> on all entries of this
+    *     <code>NonEmptyMap</code> are separated by the string <code>sep</code>. 
+    */
+  def mkString(sep: String): String = toMap.mkString(sep)
+
+  /**
+    * Displays all entries of this <code>NonEmptyMap</code> in a string using start, end, and separator strings.
+    *
+    * @param start the starting string.
+    * @param sep the separator string.
+    * @param end the ending string.
+    * @return a string representation of this <code>NonEmptyMap</code>. The resulting string begins with the string <code>start</code> and ends with the string
+    *     <code>end</code>. Inside, In the resulting string, the result of invoking <code>toString</code> on all entries of this <code>NonEmptyMap</code> are
+    *     separated by the string <code>sep</code>. 
+    */
+  def mkString(start: String, sep: String, end: String): String = toMap.mkString(start, sep, end)
+
+  /**
+    * Returns <code>true</code> to indicate this <code>NonEmptyMap</code>, like all <code>NonEmptyMap</code>s, is non-empty.
+    *
+    * @return true
+    */
+  def nonEmpty: Boolean = true
+
+  /**
+    * The result of multiplying all the entries of this <code>NonEmptyMap</code>.
+    *
+    * <p>
+    * This method can be invoked for any <code>NonEmptyMap[T]</code> for which an implicit <code>Numeric[T]</code> exists.
+    * </p>
+    *
+    * @return the product of all elements
+    */
+  def product[U >: (K, V)](implicit num: Numeric[U]): U = toMap.product(num)
+
+  /**
+    * Reduces the entries of this <code>NonEmptyMap</code> using the specified associative binary operator.
+    *
+    * <p>
+    * The order in which operations are performed on entries is unspecified and may be nondeterministic.
+    * </p>
+    *
+    * @tparam U a type parameter for the binary operator, a supertype of T.
+    * @param op a binary operator that must be associative.
+    * @return the result of applying reduce operator <code>op</code> between all the elements of this <code>NonEmptyMap</code>.
+    */
+  def reduce[U >: (K, V)](op: (U, U) => U): U = toMap.reduce(op)
+
+  /**
+    * Applies a binary operator to all entries of this <code>NonEmptyMap</code>, going left to right.
+    *
+    * @tparam U the result type of the binary operator.
+    * @param op the binary operator.
+    * @return the result of inserting <code>op</code> between consecutive entries of this <code>NonEmptyMap</code>, going left to right:
+    *
+    * <pre>
+    * op(...op(op(x_1, x_2), x_3), ..., x_n)
+    * </pre>
+    *
+    * <p>
+    * where x<sub>1</sub>, ..., x<sub>n</sub> are the elements of this <code>NonEmptyMap</code>. 
+    * </p>
+    */
+  def reduceLeft[U >: (K, V)](op: (U, (K, V)) => U): U = toMap.reduceLeft(op)
+
+  /**
+    * Applies a binary operator to all entries of this <code>NonEmptyMap</code>, going left to right, returning the result in a <code>Some</code>.
+    *
+    * @tparam U the result type of the binary operator.
+    * @param op the binary operator.
+    * @return a <code>Some</code> containing the result of <code>reduceLeft(op)</code>
+    * </p>
+    */
+  def reduceLeftOption[U >: (K, V)](op: (U, (K, V)) => U): Option[U] = toMap.reduceLeftOption(op)
+
+  def reduceOption[U >: (K, V)](op: (U, U) => U): Option[U] = toMap.reduceOption(op)
+
+  /**
+    * Applies a binary operator to all entries of this <code>NonEmptyMap</code>, going right to left.
+    *
+    * @tparam U the result of the binary operator
+    * @param op the binary operator
+    * @return the result of inserting <code>op</code> between consecutive entries of this <code>NonEmptyMap</code>, going right to left:
+    *
+    * <pre>
+    * op(x_1, op(x_2, ... op(x_{n-1}, x_n)...))
+    * </pre>
+    *
+    * <p>
+    * where x<sub>1</sub>, ..., x<sub>n</sub> are the entries of this <code>NonEmptyMap</code>.
+    * </p>
+    */
+  def reduceRight[U >: (K, V)](op: ((K, V), U) => U): U = toMap.reduceRight(op)
+
+  /**
+    * Applies a binary operator to all entries of this <code>NonEmptyMap</code>, going right to left, returning the result in a <code>Some</code>.
+    *
+    * @tparam U the result of the binary operator
+    * @param op the binary operator
+    * @return a <code>Some</code> containing the result of <code>reduceRight(op)</code>
+    */
+  def reduceRightOption[U >: (K, V)](op: ((K, V), U) => U): Option[U] = toMap.reduceRightOption(op)
+
+  /**
+    * Checks if the given <code>NonEmptyMap</code> contains the same entries in the same order as this <code>NonEmptyMap</code>.
+    *
+    * @param that the <code>NonEmptyMap</code> with which to compare
+    * @return <code>true</code>, if both this and the given <code>NonEmptyMap</code> contain the same entries
+    *     in the same order, <code>false</code> otherwise. 
+    */
+  def sameElements[V1 >: V](that: NonEmptyMap[K, V1]): Boolean = toMap == that.toMap
+
+  /**
+    * Computes a prefix scan of the entries of this <code>NonEmptyMap</code>.
+    *
+    * <p>
+    * Note: The neutral element z may be applied more than once. 
+    * </p>
+    *
+    * @param z a neutral element for the scan operation; may be added to the result an arbitrary number of
+    *     times, and must not change the result (<em>e.g.</em>, <code>Nil</code> for list concatenation,
+    *     0 for addition, or 1 for multiplication.)
+    * @param op a binary operator that must be associative
+    * @return a new <code>NonEmptyMap</code> containing the prefix scan of the elements in this <code>NonEmptyMap</code> 
+    */
+  def scan[V1 >: V](z: (K, V1))(op: ((K, V1), (K, V1)) => (K, V1)): NonEmptyMap[K, V1] = new NonEmptyMap(toMap.scan(z)(op).toMap)
+
+  /**
+    * Groups entries in fixed size blocks by passing a &ldquo;sliding window&rdquo; over them (as opposed to partitioning them, as is done in grouped.)
+    *
+    * @param size the number of entries per group
+    * @return an iterator producing <code>NonEmptyMap</code>s of size <code>size</code>, except the last and the only element will be truncated
+    *     if there are fewer entries than <code>size</code>.
+    */
+  def sliding(size: Int): Iterator[NonEmptyMap[K, V]] = toMap.sliding(size).map(new NonEmptyMap(_))
+
+  /**
+    * Groups entries in fixed size blocks by passing a &ldquo;sliding window&rdquo; over them (as opposed to partitioning them, as is done in grouped.),
+    * moving the sliding window by a given <code>step</code> each time.
+    *
+    * @param size the number of entries per group
+    * @param step the distance between the first entries of successive groups
+    * @return an iterator producing <code>NonEmptyMap</code>s of size <code>size</code>, except the last and the only element will be truncated
+    *     if there are fewer elements than <code>size</code>.
+    */
+  def sliding(size: Int, step: Int): Iterator[NonEmptyMap[K, V]] = toMap.sliding(size, step).map(new NonEmptyMap(_))
+
+  /**
+    * The size of this <code>NonEmptyMap</code>.
+    *
+    * <p>
+    * Note: <code>length</code> and <code>size</code> yield the same result, which will be <code>&gt;</code>= 1. 
+    * </p>
+    *
+    * @return the number of elements in this <code>NonEmptyMap</code>. 
+    */
+  def size: Int = toMap.size
+
+  /**
+    * Returns <code>"NonEmptyMap"</code>, the prefix of this object's <code>toString</code> representation.
+    *
+    * @return the string <code>"NonEmptyMap"</code>
+    */
+  def stringPrefix: String = "NonEmptyMap"
+
+  /**
+    * The result of summing all the elements of this <code>NonEmptyMap</code>.
+    *
+    * <p>
+    * This method can be invoked for any <code>NonEmptyMap[T]</code> for which an implicit <code>Numeric[T]</code> exists.
+    * </p>
+    *
+    * @return the sum of all elements
+    */
+  def sum[U >: (K, V)](implicit num: Numeric[U]): U = toMap.sum(num)
+
+  /**
+    * Converts this <code>NonEmptyMap</code> into a collection of type <code>Col</code> by copying all entries.
+    *
+    * @tparam C1 the collection type to build.
+    * @return a new collection containing all entries of this <code>NonEmptyMap</code>.
+    */
+  def to[C1](factory: Factory[(K, V), C1]): C1 = factory.fromSpecific(iterator)
+  /**
+    * Converts this <code>NonEmptyMap</code> to an array.
+    *
+    * @return an array containing all entries of this <code>NonEmptyMap</code>. A <code>ClassTag</code> must be available for the entry type of this <code>NonEmptyMap</code>.
+    */
+  def toArray[U >: (K, V)](implicit classTag: ClassTag[U]): Array[U] = toMap.toArray
+
+  /**
+    * Converts this <code>NonEmptyMap</code> to a <code>Vector</code>.
+    *
+    * @return a <code>Vector</code> containing all entries of this <code>NonEmptyMap</code>.
+    */
+  def toVector: Vector[(K, V)] = toMap.toVector
+
+  /**
+    * Converts this <code>NonEmptyMap</code> to a mutable buffer.
+    *
+    * @return a buffer containing all entries of this <code>NonEmptyMap</code>.
+    */
+  def toBuffer[U >: (K, V)]: mutable.Buffer[U] = toMap.toBuffer
+
+  /**
+    * Converts this <code>NonEmptyMap</code> to an immutable <code>IndexedSeq</code>.
+    *
+    * @return an immutable <code>IndexedSeq</code> containing all entries of this <code>NonEmptyMap</code>.
+    */
+  def toIndexedSeq: collection.immutable.IndexedSeq[(K, V)] = toMap.toVector
+
+  /**
+    * Converts this <code>NonEmptyMap</code> to an iterable collection.
+    *
+    * @return an <code>Iterable</code> containing all entries of this <code>NonEmptyMap</code>.
+    */
+  def toIterable: Iterable[(K, V)] = toMap.toIterable
+
+  /**
+    * Returns an <code>Iterator</code> over the entries in this <code>NonEmptyMap</code>.
+    *
+    * @return an <code>Iterator</code> containing all entries of this <code>NonEmptyMap</code>.
+    */
+  def toIterator: Iterator[(K, V)] = toMap.iterator
+
+  /**
+    * Converts this <code>NonEmptyMap</code> to an immutable <code>IndexedSeq</code>.
+    *
+    * @return an immutable <code>IndexedSeq</code> containing all entries of this <code>NonEmptyMap</code>.
+    */
+  def toSeq: collection.immutable.Seq[(K, V)] = collection.immutable.Seq.empty[(K, V)] ++ toMap.toSeq
+
+  /**
+    * Converts this <code>NonEmptyMap</code> to a set.
+    *
+    * @return a set containing all entries of this <code>NonEmptyMap</code>.
+    */
+  def toSet[U >: (K, V)]: Set[U] = toMap.toSet
+
+
+  /**
+    * Returns a string representation of this <code>NonEmptyMap</code>.
+    *
+    * @return the string <code>"NonEmptyMap"</code> followed by the result of invoking <code>toString</code> on
+    *   this <code>NonEmptyMap</code>'s elements, surrounded by parentheses.
+    */
+  override def toString: String = "NonEmptyMap(" + toMap.mkString(", ") + ")"
+
+  /**
+    * Converts this <code>NonEmptyMap</code> of pairs into two <code>Iterable</code>s of the first and second half of each pair.
+    *
+    * @tparam L the type of the first half of the element pairs
+    * @tparam R the type of the second half of the element pairs
+    * @param asPair an implicit conversion that asserts that the element type of this <code>NonEmptyMap</code> is a pair.
+    * @return a pair of <code>NonEmptyMap</code>s, containing the first and second half, respectively, of each element pair of this <code>NonEmptyMap</code>. 
+    */
+  def unzip[L, R](implicit asPair: ((K, V)) => (L, R)): (scala.collection.immutable.Iterable[L], scala.collection.immutable.Iterable[R]) = toMap.unzip
+
+  /**
+    * Converts this <code>NonEmptyMap</code> of triples into three <code>NonEmptyMap</code>s of the first, second, and and third entry of each triple.
+    *
+    * @tparam L the type of the first member of the entry triples
+    * @tparam R the type of the second member of the entry triples
+    * @tparam R the type of the third member of the entry triples
+    * @param asTriple an implicit conversion that asserts that the entry type of this <code>NonEmptyMap</code> is a triple.
+    * @return a triple of <code>NonEmptyMap</code>s, containing the first, second, and third member, respectively, of each entry triple of this <code>NonEmptyMap</code>.
+    */
+  def unzip3[L, M, R](implicit asTriple: ((K, V)) => (L, M, R)): (scala.collection.immutable.Iterable[L], scala.collection.immutable.Iterable[M], scala.collection.immutable.Iterable[R]) = toMap.unzip3
+
+  /**
+    * A copy of this <code>NonEmptyMap</code> with one single replaced entry.
+    *
+    * @param key the key of the replacement
+    * @param value the replacing value
+    * @return a copy of this <code>NonEmptyMap</code> with the value at <code>key</code> replaced by the given <code>value</code>.
+    */
+  def updated[V1 >: V](key: K, value: V1): NonEmptyMap[K, V1] =
+    new NonEmptyMap(toMap.updated(key, value))
+
+  /**
+    * Returns a <code>NonEmptyMap</code> formed from this <code>NonEmptyMap</code> and an iterable collection by combining corresponding
+    * entries in pairs. If one of the two collections is shorter than the other, placeholder entries will be used to extend the
+    * shorter collection to the length of the longer.
+    *
+    * @tparam O the type of the second half of the returned pairs
+    * @tparam V1 the subtype of the value type of this <code>NonEmptyMap</code>
+    * @param other the <code>Iterable</code> providing the second half of each result pair
+    * @param thisElem the element to be used to fill up the result if this <code>NonEmptyMap</code> is shorter than <code>that</code> <code>Iterable</code>.
+    * @param otherElem the element to be used to fill up the result if <code>that</code> <code>Iterable</code> is shorter than this <code>NonEmptyMap</code>.
+    * @return a new <code>NonEmptyMap</code> containing pairs consisting of corresponding entries of this <code>NonEmptyMap</code> and <code>that</code>. The
+    *     length of the returned collection is the maximum of the lengths of this <code>NonEmptyMap</code> and <code>that</code>. If this <code>NonEmptyMap</code>
+    *     is shorter than <code>that</code>, <code>thisElem</code> values are used to pad the result. If <code>that</code> is shorter than this
+    *     <code>NonEmptyMap</code>, <code>thatElem</code> values are used to pad the result. 
+    */
+  def zipAll[O, V1 >: V](other: collection.Iterable[O], thisElem: (K, V1), otherElem: O): NonEmptyMap[(K, V1), O] =
+    new NonEmptyMap(toMap.zipAll(other, thisElem, otherElem).toMap)
+
+  /**
+    * Zips this <code>NonEmptyMap</code>  with its indices.
+    *
+    * @return A new <code>NonEmptyMap</code> containing pairs consisting of all elements of this <code>NonEmptyMap</code> paired with their index. Indices start at 0.
+    */
+  def zipWithIndex[V1 >: V]: NonEmptyMap[(K, V1), Int] = new NonEmptyMap(toMap.zipWithIndex.toMap)
+}
+
+/**
+  * Companion object for class <code>NonEmptyMap</code>.
+  */
+object NonEmptyMap {
+
+  /**
+    * Constructs a new <code>NonEmptyMap</code> given at least one element.
+    *
+    * @tparam K the type of the key contained in the new <code>NonEmptyMap</code>
+    * @tparam V the type of the value contained in the new <code>NonEmptyMap</code>
+    * @param firstElement the first element (with index 0) contained in this <code>NonEmptyMap</code>
+    * @param otherElements a varargs of zero or more other elements (with index 1, 2, 3, ...) contained in this <code>NonEmptyMap</code>
+    */
+  def apply[K, V](firstElement: (K, V), otherElements: (K, V)*): NonEmptyMap[K, V] = new NonEmptyMap(otherElements.toMap + firstElement)
+
+  /**
+    * Variable argument extractor for <code>NonEmptyMap</code>s.
+    *
+    * @tparam K the type of the key contained in the <code>NonEmptyMap</code>
+    * @tparam V the type of the value contained in the <code>NonEmptyMap</code>
+    * @param nonEmptyMap: the <code>NonEmptyMap</code> containing the elements to extract
+    * @return an <code>Seq</code> containing this <code>NonEmptyMap</code>s elements, wrapped in a <code>Some</code> 
+    */
+  def unapplySeq[K, V](nonEmptyMap: NonEmptyMap[K, V]): Option[Seq[(K, V)]] = Some(nonEmptyMap.toSeq)
+
+  /**
+    * Optionally construct a <code>NonEmptyMap</code> containing the elements, if any, of a given <code>Seq</code>.
+    *
+    * @tparam K the type of the key contained in the new <code>NonEmptyMap</code>
+    * @tparam V the type of the value contained in the new <code>NonEmptyMap</code>
+    * @param seq the <code>Seq</code> with which to construct a <code>NonEmptyMap</code>
+    * @return a <code>NonEmptyMap</code> containing the elements of the given <code>Seq</code>, if non-empty, wrapped in
+    *     a <code>Some</code>; else <code>None</code> if the <code>Seq</code> is empty
+    */
+  def from[K, V](seq: Seq[(K, V)]): Option[NonEmptyMap[K, V]] =
+    seq.headOption match {
+      case None => None
+      case Some(first) => Some(new NonEmptyMap(scala.collection.immutable.Map.empty[K, V] ++ seq.tail.toMap + first))
+    }
+
+  def from[K, V](map: scala.collection.Map[K, V]): Option[NonEmptyMap[K, V]] =
+    map.headOption match {
+      case None => None
+      case Some(_) => Some(new NonEmptyMap(scala.collection.immutable.Map.empty[K, V] ++ map))
+    }
+
+}
diff --git a/fundamentals/fundamentals-collections/src/main/scala/izumi/fundamentals/collections/nonempty/NonEmptySet.scala b/fundamentals/fundamentals-collections/src/main/scala/izumi/fundamentals/collections/nonempty/NonEmptySet.scala
new file mode 100644
index 000000000..b7bc076e7
--- /dev/null
+++ b/fundamentals/fundamentals-collections/src/main/scala/izumi/fundamentals/collections/nonempty/NonEmptySet.scala
@@ -0,0 +1,1029 @@
+package izumi.fundamentals.collections.nonempty
+
+// shameless copypaste from Scalactic
+
+import scala.collection.compat._
+import scala.collection.mutable.{ArrayBuffer, Buffer}
+import scala.collection.{Iterable, Set}
+import scala.reflect.ClassTag
+
+
+// Can't be a LinearSeq[T] because Builder would be able to create an empty one.
+/**
+  * A non-empty Set: an ordered, immutable, non-empty collection of elements with <code>LinearSeq</code> performance characteristics.
+  *
+  * <p>
+  * The purpose of <code>NonEmptySet</code> is to allow you to express in a type that a <code>Set</code> is non-empty, thereby eliminating the
+  * need for (and potential exception from) a run-time check for non-emptiness. For a non-empty sequence with <code>IndexedSeq</code>
+  * performance, see <a href="Vector.html"><code>Vector</code></a>.
+  * </p>
+  *
+  * <h2>Constructing <code>NonEmptySet</code>s</h2>
+  *
+  * <p>
+  * You can construct a <code>NonEmptySet</code> by passing one or more elements to the <code>NonEmptySet.apply</code> factory method:
+  * </p>
+  *
+  * <pre class="stHighlight">
+  * scala&gt; NonEmptySet(1, 2, 3)
+  * res0: org.scalactic.anyvals.NonEmptySet[Int] = NonEmptySet(1, 2, 3)
+  * </pre>
+  *
+  * <p>
+  * Alternatively you can <em>cons</em> elements onto the <code>End</code> singleton object, similar to making a <code>Set</code> starting with <code>Nil</code>:
+  * </p>
+  *
+  * <pre class="stHighlight">
+  * scala&gt; 1 :: 2 :: 3 :: Nil
+  * res0: Set[Int] = Set(1, 2, 3)
+  *
+  * scala&gt; 1 :: 2 :: 3 :: End
+  * res1: org.scalactic.NonEmptySet[Int] = NonEmptySet(1, 2, 3)
+  * </pre>
+  *
+  * <p>
+  * Note that although <code>Nil</code> is a <code>Set[Nothing]</code>, <code>End</code> is
+  * not a <code>NonEmptySet[Nothing]</code>, because no empty <code>NonEmptySet</code> exists. (A non-empty Set is a series
+  * of connected links; if you have no links, you have no non-empty Set.)
+  * </p>
+  *
+  * <pre class="stHighlight">
+  * scala&gt; val nil: Set[Nothing] = Nil
+  * nil: Set[Nothing] = Set()
+  *
+  * scala&gt; val nada: NonEmptySet[Nothing] = End
+  * &lt;console&gt;:16: error: type mismatch;
+  * found   : org.scalactic.anyvals.End.type
+  * required: org.scalactic.anyvals.NonEmptySet[Nothing]
+  *        val nada: NonEmptySet[Nothing] = End
+  *                                          ^
+  * </pre>
+  *
+  * <h2>Working with <code>NonEmptySet</code>s</h2>
+  *
+  * <p>
+  * <code>NonEmptySet</code> does not extend Scala's <code>Seq</code> or <code>Traversable</code> traits because these require that
+  * implementations may be empty. For example, if you invoke <code>tail</code> on a <code>Seq</code> that contains just one element,
+  * you'll get an empty <code>Seq</code>:
+  * </p>
+  *
+  * <pre class="stREPL">
+  * scala&gt; Set(1).tail
+  * res6: Set[Int] = Set()
+  * </pre>
+  *
+  * <p>
+  * On the other hand, many useful methods exist on <code>Seq</code> that when invoked on a non-empty <code>Seq</code> are guaranteed
+  * to not result in an empty <code>Seq</code>. For convenience, <code>NonEmptySet</code> defines a method corresponding to every such <code>Seq</code>
+  * method. Here are some examples:
+  * </p>
+  *
+  * <pre class="stHighlight">
+  * NonEmptySet(1, 2, 3).map(_ + 1)                        // Result: NonEmptySet(2, 3, 4)
+  * NonEmptySet(1).map(_ + 1)                              // Result: NonEmptySet(2)
+  * NonEmptySet(1, 2, 3).containsSlice(NonEmptySet(2, 3)) // Result: true
+  * NonEmptySet(1, 2, 3).containsSlice(NonEmptySet(3, 4)) // Result: false
+  * NonEmptySet(-1, -2, 3, 4, 5).minBy(_.abs)              // Result: -1
+  * </pre>
+  *
+  * <p>
+  * <code>NonEmptySet</code> does <em>not</em> currently define any methods corresponding to <code>Seq</code> methods that could result in
+  * an empty <code>Seq</code>. However, an implicit converison from <code>NonEmptySet</code> to <code>Set</code>
+  * is defined in the <code>NonEmptySet</code> companion object that will be applied if you attempt to call one of the missing methods. As a
+  * result, you can invoke <code>filter</code> on an <code>NonEmptySet</code>, even though <code>filter</code> could result
+  * in an empty sequence&mdash;but the result type will be <code>Set</code> instead of <code>NonEmptySet</code>:
+  * </p>
+  *
+  * <pre class="stHighlight">
+  * NonEmptySet(1, 2, 3).filter(_ &lt; 10) // Result: Set(1, 2, 3)
+  * NonEmptySet(1, 2, 3).filter(_ &gt; 10) // Result: Set()
+  * </pre>
+  *
+  *
+  * <p>
+  * You can use <code>NonEmptySet</code>s in <code>for</code> expressions. The result will be an <code>NonEmptySet</code> unless
+  * you use a filter (an <code>if</code> clause). Because filters are desugared to invocations of <code>filter</code>, the
+  * result type will switch to a <code>Set</code> at that point. Here are some examples:
+  * </p>
+  *
+  * <pre class="stREPL">
+  * scala&gt; import org.scalactic.anyvals._
+  * import org.scalactic.anyvals._
+  *
+  * scala&gt; for (i &lt;- NonEmptySet(1, 2, 3)) yield i + 1
+  * res0: org.scalactic.anyvals.NonEmptySet[Int] = NonEmptySet(2, 3, 4)
+  *
+  * scala&gt; for (i &lt;- NonEmptySet(1, 2, 3) if i &lt; 10) yield i + 1
+  * res1: Set[Int] = Set(2, 3, 4)
+  *
+  * scala&gt; for {
+  *      |   i &lt;- NonEmptySet(1, 2, 3)
+  *      |   j &lt;- NonEmptySet('a', 'b', 'c')
+  *      | } yield (i, j)
+  * res3: org.scalactic.anyvals.NonEmptySet[(Int, Char)] =
+  *         NonEmptySet((1,a), (1,b), (1,c), (2,a), (2,b), (2,c), (3,a), (3,b), (3,c))
+  *
+  * scala&gt; for {
+  *      |   i &lt;- NonEmptySet(1, 2, 3) if i &lt; 10
+  *      |   j &lt;- NonEmptySet('a', 'b', 'c')
+  *      | } yield (i, j)
+  * res6: Set[(Int, Char)] =
+  *         Set((1,a), (1,b), (1,c), (2,a), (2,b), (2,c), (3,a), (3,b), (3,c))
+  * </pre>
+  *
+  * @tparam T the type of elements contained in this <code>NonEmptySet</code>
+  */
+final class NonEmptySet[T] private (val toSet: Set[T]) extends AnyVal {
+
+  /**
+    * Returns a new <code>NonEmptySet</code> containing the elements of this <code>NonEmptySet</code> followed by the elements of the passed <code>NonEmptySet</code>.
+    * The element type of the resulting <code>NonEmptySet</code> is the most specific superclass encompassing the element types of this and the passed <code>NonEmptySet</code>.
+    *
+    * @tparam U the element type of the returned <code>NonEmptySet</code>
+    * @param other the <code>NonEmptySet</code> to append
+    * @return a new <code>NonEmptySet</code> that contains all the elements of this <code>NonEmptySet</code> followed by all elements of <code>other</code>.
+    */
+  def ++[U >: T](other: NonEmptySet[U]): NonEmptySet[U] = new NonEmptySet(toSet ++ other.toSet)
+
+  /**
+    * Returns a new <code>NonEmptySet</code> containing the elements of this <code>NonEmptySet</code> followed by the elements of the passed <code>Vector</code>.
+    * The element type of the resulting <code>NonEmptySet</code> is the most specific superclass encompassing the element types of this <code>NonEmptySet</code> and the passed <code>Vector</code>.
+    *
+    * @tparam U the element type of the returned <code>NonEmptySet</code>
+    * @param other the <code>Vector</code> to append
+    * @return a new <code>NonEmptySet</code> that contains all the elements of this <code>NonEmptySet</code> followed by all elements of <code>other</code>.
+    */
+  def ++[U >: T](other: Vector[U]): NonEmptySet[U] = new NonEmptySet(toSet ++ other)
+
+  // TODO: Have I added these extra ++, etc. methods to Vector that take a NonEmptySet?
+
+  /**
+    * Returns a new <code>NonEmptySet</code> containing the elements of this <code>NonEmptySet</code> followed by the elements of the passed <code>GenTraversableOnce</code>.
+    * The element type of the resulting <code>NonEmptySet</code> is the most specific superclass encompassing the element types of this <code>NonEmptySet</code>
+    * and the passed <code>GenTraversableOnce</code>.
+    *
+    * @param other the <code>GenTraversableOnce</code> to append
+    * @return a new <code>NonEmptySet</code> that contains all the elements of this <code>NonEmptySet</code> followed by all elements of <code>other</code>.
+    */
+  def ++(other: IterableOnce[T]): NonEmptySet[T] =
+    if (other.iterator.isEmpty) this else new NonEmptySet(toSet ++ other.iterator.to(Set))
+
+  /**
+    * Returns a new <code>NonEmptySet</code> with the given element added.
+    *
+    *
+    * @param element the element to add to this <code>NonEmptySet</code>
+    * @return a new <code>NonEmptySet</code> consisting of <code>element</code> and all elements of this <code>NonEmptySet</code>.
+    */
+  def +(element: T): NonEmptySet[T] = new NonEmptySet(toSet ++ Set(element))
+
+  /**
+    * Returns a new <code>NonEmptySet</code> with the given element added.
+    *
+    * @param elem1 the first element to add.
+    * @param elem2 the second element to add.
+    * @param elems the remaining elements to add.
+    * @return   a new <code>NonEmptySet</code> with the given elements added, omitting duplicates.
+    */
+  def +(elem1: T, elem2: T, elems: T*): NonEmptySet[T] = new NonEmptySet(toSet ++ Set(elem1, elem2) ++ elems)
+
+  /**
+    * Appends all elements of this <code>NonEmptySet</code> to a string builder. The written text will consist of a concatenation of the result of invoking <code>toString</code>
+    * on of every element of this <code>NonEmptySet</code>, without any separator string.
+    *
+    * @param sb the string builder to which elements will be appended
+    * @return the string builder, <code>sb</code>, to which elements were appended.
+    */
+  def addString(sb: StringBuilder): StringBuilder = toSet.addString(sb)
+
+  /**
+    * Check if an element exists at its index in the <code>NonEmptySet</code>.
+    *
+    * @return <code>true</code> if a element exists in <code>NonEmptySet</code> at index <code>idx</code>, where <code>false</code> indicates the element at index <code>idx</code> does not exist.
+    */
+  def apply(elem: T): Boolean = toSet(elem)
+
+  /**
+    * Appends all elements of this <code>NonEmptySet</code> to a string builder using a separator string. The written text will consist of a concatenation of the
+    * result of invoking <code>toString</code>
+    * on of every element of this <code>NonEmptySet</code>, separated by the string <code>sep</code>.
+    *
+    * @param sb the string builder to which elements will be appended
+    * @param sep the separator string
+    * @return the string builder, <code>sb</code>, to which elements were appended.
+    */
+  def addString(sb: StringBuilder, sep: String): StringBuilder = toSet.addString(sb, sep)
+
+  /**
+    * Appends all elements of this <code>NonEmptySet</code> to a string builder using start, end, and separator strings. The written text will consist of a concatenation of
+    * the string <code>start</code>; the result of invoking <code>toString</code> on all elements of this <code>NonEmptySet</code>,
+    * separated by the string <code>sep</code>; and the string <code>end</code>
+    *
+    * @param sb the string builder to which elements will be appended
+    * @param start the starting string
+    * @param sep the separator string
+    * @param start the ending string
+    * @return the string builder, <code>sb</code>, to which elements were appended.
+    */
+  def addString(sb: StringBuilder, start: String, sep: String, end: String): StringBuilder = toSet.addString(sb, start, sep, end)
+
+  /**
+    * Finds the first element of this <code>NonEmptySet</code> for which the given partial function is defined, if any, and applies the partial function to it.
+    *
+    * @param pf the partial function
+    * @return an <code>Option</code> containing <code>pf</code> applied to the first element for which it is defined, or <code>None</code> if
+    *    the partial function was not defined for any element.
+    */
+  def collectFirst[U](pf: PartialFunction[T, U]): Option[U] = toSet.collectFirst(pf)
+
+  /**
+    * Indicates whether this <code>NonEmptySet</code> contains a given value as an element.
+    *
+    * @param elem the element to look for
+    * @return true if this <code>NonEmptySet</code> has an element that is equal (as determined by <code>==)</code> to <code>elem</code>, false otherwise.
+    */
+  def contains(elem: T): Boolean = toSet.contains(elem)
+
+  /**
+    * Copies values of this <code>NonEmptySet</code> to an array. Fills the given array <code>arr</code> with values of this <code>NonEmptySet</code>. Copying
+    * will stop once either the end of the current <code>NonEmptySet</code> is reached, or the end of the array is reached.
+    *
+    * @param arr the array to fill
+    */
+  def copyToArray[U >: T](arr: Array[U]): Unit = {
+    toSet.copyToArray(arr)
+    ()
+  }
+
+  /**
+    * Copies values of this <code>NonEmptySet</code> to an array. Fills the given array <code>arr</code> with values of this <code>NonEmptySet</code>, beginning at
+    * index <code>start</code>. Copying will stop once either the end of the current <code>NonEmptySet</code> is reached, or the end of the array is reached.
+    *
+    * @param arr the array to fill
+    * @param start the starting index
+    */
+  def copyToArray[U >: T](arr: Array[U], start: Int): Unit = {
+    toSet.copyToArray(arr, start)
+    ()
+  }
+
+  /**
+    * Copies values of this <code>NonEmptySet</code> to an array. Fills the given array <code>arr</code> with at most <code>len</code> elements of this <code>NonEmptySet</code>, beginning at
+    * index <code>start</code>. Copying will stop once either the end of the current <code>NonEmptySet</code> is reached, the end of the array is reached, or
+    * <code>len</code> elements have been copied.
+    *
+    * @param arr the array to fill
+    * @param start the starting index
+    * @param len the maximum number of elements to copy
+    */
+  def copyToArray[U >: T](arr: Array[U], start: Int, len: Int): Unit = {
+    toSet.copyToArray(arr, start, len)
+    ()
+  }
+
+  /**
+    * Copies all elements of this <code>NonEmptySet</code> to a buffer.
+    *
+    * @param buf the buffer to which elements are copied
+    */
+  def copyToBuffer[U >: T](buf: Buffer[U]): Unit = {
+    buf ++= toSet
+    ()
+  }
+
+  /**
+    * Counts the number of elements in this <code>NonEmptySet</code> that satisfy a predicate.
+    *
+    * @param p the predicate used to test elements.
+    * @return the number of elements satisfying the predicate <code>p</code>.
+    */
+  def count(p: T => Boolean): Int = toSet.count(p)
+
+  /**
+    * Indicates whether a predicate holds for at least one of the elements of this <code>NonEmptySet</code>.
+    *
+    * @param p the predicate used to test elements.
+    * @return <code>true</code> if the given predicate <code>p</code> holds for some of the elements of this <code>NonEmptySet</code>, otherwise <code>false</code>.
+    */
+  def exists(p: T => Boolean): Boolean = toSet.exists(p)
+
+  /**
+    * Finds the first element of this <code>NonEmptySet</code> that satisfies the given predicate, if any.
+    *
+    * @param p the predicate used to test elements
+    * @return an <code>Some</code> containing the first element in this <code>NonEmptySet</code> that satisfies <code>p</code>, or <code>None</code> if none exists.
+    */
+  def find(p: T => Boolean): Option[T] = toSet.find(p)
+
+  /**
+    * Builds a new <code>NonEmptySet</code> by applying a function to all elements of this <code>NonEmptySet</code> and using the elements of the resulting <code>NonEmptySet</code>s.
+    *
+    * @tparam U the element type of the returned <code>NonEmptySet</code>
+    * @param f the function to apply to each element.
+    * @return a new <code>NonEmptySet</code> containing elements obtained by applying the given function <code>f</code> to each element of this <code>NonEmptySet</code> and concatenating
+    *    the elements of resulting <code>NonEmptySet</code>s.
+    */
+  def flatMap[U](f: T => NonEmptySet[U]): NonEmptySet[U] = {
+    val buf = new ArrayBuffer[U]
+    for (ele <- toSet)
+      buf ++= f(ele).toSet
+    new NonEmptySet(buf.toSet)
+  }
+
+  /**
+    * Converts this <code>NonEmptySet</code> of <code>NonEmptySet</code>s into a <code>NonEmptySet</code>
+    * formed by the elements of the nested <code>NonEmptySet</code>s.
+    *
+    * <p>
+    * Note: You cannot use this <code>flatten</code> method on a <code>NonEmptySet</code> that contains a <code>GenTraversableOnce</code>s, because
+    * if all the nested <code>GenTraversableOnce</code>s were empty, you'd end up with an empty <code>NonEmptySet</code>.
+    * </p>
+    *
+    * @tparm B the type of the elements of each nested <code>NonEmptySet</code>
+    * @return a new <code>NonEmptySet</code> resulting from concatenating all nested <code>NonEmptySet</code>s.
+    */
+  def flatten[B](implicit ev: T <:< NonEmptySet[B]): NonEmptySet[B] = flatMap(ev)
+
+  /**
+    * Folds the elements of this <code>NonEmptySet</code> using the specified associative binary operator.
+    *
+    * <p>
+    * The order in which operations are performed on elements is unspecified and may be nondeterministic.
+    * </p>
+    *
+    * @tparam U a type parameter for the binary operator, a supertype of T.
+    * @param z a neutral element for the fold operation; may be added to the result an arbitrary number of
+    *     times, and must not change the result (<em>e.g.</em>, <code>Nil</code> for Set concatenation,
+    *     0 for addition, or 1 for multiplication.)
+    * @param op a binary operator that must be associative
+    * @return the result of applying fold operator <code>op</code> between all the elements and <code>z</code>
+    */
+  def fold[U >: T](z: U)(op: (U, U) => U): U = toSet.fold(z)(op)
+
+  /**
+    * Applies a binary operator to a start value and all elements of this <code>NonEmptySet</code>, going left to right.
+    *
+    * @tparam B the result type of the binary operator.
+    * @param z the start value.
+    * @param op the binary operator.
+    * @return the result of inserting <code>op</code> between consecutive elements of this <code>NonEmptySet</code>, going left to right, with the start value,
+    *     <code>z</code>, on the left:
+    *
+    * <pre>
+    * op(...op(op(z, x_1), x_2), ..., x_n)
+    * </pre>
+    *
+    * <p>
+    * where x<sub>1</sub>, ..., x<sub>n</sub> are the elements of this <code>NonEmptySet</code>.
+    * </p>
+    */
+  def foldLeft[B](z: B)(op: (B, T) => B): B = toSet.foldLeft(z)(op)
+
+  /**
+    * Applies a binary operator to all elements of this <code>NonEmptySet</code> and a start value, going right to left.
+    *
+    * @tparam B the result of the binary operator
+    * @param z the start value
+    * @param op the binary operator
+    * @return the result of inserting <code>op</code> between consecutive elements of this <code>NonEmptySet</code>, going right to left, with the start value,
+    *     <code>z</code>, on the right:
+    *
+    * <pre>
+    * op(x_1, op(x_2, ... op(x_n, z)...))
+    * </pre>
+    *
+    * <p>
+    * where x<sub>1</sub>, ..., x<sub>n</sub> are the elements of this <code>NonEmptySet</code>.
+    * </p>
+    */
+  def foldRight[B](z: B)(op: (T, B) => B): B = toSet.foldRight(z)(op)
+
+  /**
+    * Indicates whether a predicate holds for all elements of this <code>NonEmptySet</code>.
+    *
+    * @param p the predicate used to test elements.
+    * @return <code>true</code> if the given predicate <code>p</code> holds for all elements of this <code>NonEmptySet</code>, otherwise <code>false</code>.
+    */
+  def forall(p: T => Boolean): Boolean = toSet.forall(p)
+
+  /**
+    * Applies a function <code>f</code> to all elements of this <code>NonEmptySet</code>.
+    *
+    * @param f the function that is applied for its side-effect to every element. The result of function <code>f</code> is discarded.
+    */
+  def foreach(f: T => Unit): Unit = toSet.foreach(f)
+
+  /**
+    * Partitions this <code>NonEmptySet</code> into a map of <code>NonEmptySet</code>s according to some discriminator function.
+    *
+    * @tparam K the type of keys returned by the discriminator function.
+    * @param f the discriminator function.
+    * @return A map from keys to <code>NonEmptySet</code>s such that the following invariant holds:
+    *
+    * <pre>
+    * (NonEmptySet.toSet partition f)(k) = xs filter (x =&gt; f(x) == k)
+    * </pre>
+    *
+    * <p>
+    * That is, every key <code>k</code> is bound to a <code>NonEmptySet</code> of those elements <code>x</code> for which <code>f(x)</code> equals <code>k</code>.
+    * </p>
+    */
+  def groupBy[K](f: T => K): Map[K, NonEmptySet[T]] = {
+    val mapKToSet = toSet.groupBy(f)
+    mapKToSet.view.mapValues { Set => new NonEmptySet(Set) }.toMap
+  }
+
+  /**
+    * Partitions elements into fixed size <code>NonEmptySet</code>s.
+    *
+    * @param size the number of elements per group
+    * @return An iterator producing <code>NonEmptySet</code>s of size <code>size</code>, except the last will be truncated if the elements don't divide evenly.
+    */
+  def grouped(size: Int): Iterator[NonEmptySet[T]] = {
+    val itOfSet = toSet.grouped(size)
+    itOfSet.map { Set => new NonEmptySet(Set) }
+  }
+
+  /**
+    * Returns <code>true</code> to indicate this <code>NonEmptySet</code> has a definite size, since all <code>NonEmptySet</code>s are strict collections.
+    */
+  def hasDefiniteSize: Boolean = true
+
+  // override def hashCode: Int = toSet.hashCode
+
+  /**
+    * Selects the first element of this <code>NonEmptySet</code>.
+    *
+    * @return the first element of this <code>NonEmptySet</code>.
+    */
+  def head: T = toSet.head
+
+  /**
+    * Returns <code>false</code> to indicate this <code>NonEmptySet</code>, like all <code>NonEmptySet</code>s, is non-empty.
+    *
+    * @return false
+    */
+  def isEmpty: Boolean = false
+
+  /**
+    * Returns <code>true</code> to indicate this <code>NonEmptySet</code>, like all <code>NonEmptySet</code>s, can be traversed repeatedly.
+    *
+    * @return true
+    */
+  def isTraversableAgain: Boolean = true
+
+  /**
+    * Creates and returns a new iterator over all elements contained in this <code>NonEmptySet</code>.
+    *
+    * @return the new iterator
+    */
+  def iterator: Iterator[T] = toSet.iterator
+
+  /**
+    * Selects the last element of this <code>NonEmptySet</code>.
+    *
+    * @return the last element of this <code>NonEmptySet</code>.
+    */
+  def last: T = toSet.last
+
+
+  /**
+    * Builds a new <code>NonEmptySet</code> by applying a function to all elements of this <code>NonEmptySet</code>.
+    *
+    * @tparam U the element type of the returned <code>NonEmptySet</code>.
+    * @param f the function to apply to each element.
+    * @return a new <code>NonEmptySet</code> resulting from applying the given function <code>f</code> to each element of this <code>NonEmptySet</code> and collecting the results.
+    */
+  def map[U](f: T => U): NonEmptySet[U] =
+    new NonEmptySet(toSet.map(f))
+
+  /**
+    * Finds the largest element.
+    *
+    * @return the largest element of this <code>NonEmptySet</code>.
+    */
+  def max[U >: T](implicit cmp: Ordering[U]): T = toSet.max(cmp)
+
+  /**
+    * Finds the largest result after applying the given function to every element.
+    *
+    * @return the largest result of applying the given function to every element of this <code>NonEmptySet</code>.
+    */
+  def maxBy[U](f: T => U)(implicit cmp: Ordering[U]): T = toSet.maxBy(f)(cmp)
+
+  /**
+    * Finds the smallest element.
+    *
+    * @return the smallest element of this <code>NonEmptySet</code>.
+    */
+  def min[U >: T](implicit cmp: Ordering[U]): T = toSet.min(cmp)
+
+  /**
+    * Finds the smallest result after applying the given function to every element.
+    *
+    * @return the smallest result of applying the given function to every element of this <code>NonEmptySet</code>.
+    */
+  def minBy[U](f: T => U)(implicit cmp: Ordering[U]): T = toSet.minBy(f)(cmp)
+
+  /**
+    * Displays all elements of this <code>NonEmptySet</code> in a string.
+    *
+    * @return a string representation of this <code>NonEmptySet</code>. In the resulting string, the result of invoking <code>toString</code> on all elements of this
+    *     <code>NonEmptySet</code> follow each other without any separator string.
+    */
+  def mkString: String = toSet.mkString
+
+  /**
+    * Displays all elements of this <code>NonEmptySet</code> in a string using a separator string.
+    *
+    * @param sep the separator string
+    * @return a string representation of this <code>NonEmptySet</code>. In the resulting string, the result of invoking <code>toString</code> on all elements of this
+    *     <code>NonEmptySet</code> are separated by the string <code>sep</code>.
+    */
+  def mkString(sep: String): String = toSet.mkString(sep)
+
+  /**
+    * Displays all elements of this <code>NonEmptySet</code> in a string using start, end, and separator strings.
+    *
+    * @param start the starting string.
+    * @param sep the separator string.
+    * @param end the ending string.
+    * @return a string representation of this <code>NonEmptySet</code>. The resulting string begins with the string <code>start</code> and ends with the string
+    *     <code>end</code>. Inside, In the resulting string, the result of invoking <code>toString</code> on all elements of this <code>NonEmptySet</code> are
+    *     separated by the string <code>sep</code>.
+    */
+  def mkString(start: String, sep: String, end: String): String = toSet.mkString(start, sep, end)
+
+  /**
+    * Returns <code>true</code> to indicate this <code>NonEmptySet</code>, like all <code>NonEmptySet</code>s, is non-empty.
+    *
+    * @return true
+    */
+  def nonEmpty: Boolean = true
+
+  /**
+    * The result of multiplying all the elements of this <code>NonEmptySet</code>.
+    *
+    * <p>
+    * This method can be invoked for any <code>NonEmptySet[T]</code> for which an implicit <code>Numeric[T]</code> exists.
+    * </p>
+    *
+    * @return the product of all elements
+    */
+  def product[U >: T](implicit num: Numeric[U]): U = toSet.product(num)
+
+  /**
+    * Reduces the elements of this <code>NonEmptySet</code> using the specified associative binary operator.
+    *
+    * <p>
+    * The order in which operations are performed on elements is unspecified and may be nondeterministic.
+    * </p>
+    *
+    * @tparam U a type parameter for the binary operator, a supertype of T.
+    * @param op a binary operator that must be associative.
+    * @return the result of applying reduce operator <code>op</code> between all the elements of this <code>NonEmptySet</code>.
+    */
+  def reduce[U >: T](op: (U, U) => U): U = toSet.reduce(op)
+
+  /**
+    * Applies a binary operator to all elements of this <code>NonEmptySet</code>, going left to right.
+    *
+    * @tparam U the result type of the binary operator.
+    * @param op the binary operator.
+    * @return the result of inserting <code>op</code> between consecutive elements of this <code>NonEmptySet</code>, going left to right:
+    *
+    * <pre>
+    * op(...op(op(x_1, x_2), x_3), ..., x_n)
+    * </pre>
+    *
+    * <p>
+    * where x<sub>1</sub>, ..., x<sub>n</sub> are the elements of this <code>NonEmptySet</code>.
+    * </p>
+    */
+  def reduceLeft[U >: T](op: (U, T) => U): U = toSet.reduceLeft(op)
+
+  /**
+    * Applies a binary operator to all elements of this <code>NonEmptySet</code>, going left to right, returning the result in a <code>Some</code>.
+    *
+    * @tparam U the result type of the binary operator.
+    * @param op the binary operator.
+    * @return a <code>Some</code> containing the result of <code>reduceLeft(op)</code>
+    * </p>
+    */
+  def reduceLeftOption[U >: T](op: (U, T) => U): Option[U] = toSet.reduceLeftOption(op)
+
+  def reduceOption[U >: T](op: (U, U) => U): Option[U] = toSet.reduceOption(op)
+
+  /**
+    * Applies a binary operator to all elements of this <code>NonEmptySet</code>, going right to left.
+    *
+    * @tparam U the result of the binary operator
+    * @param op the binary operator
+    * @return the result of inserting <code>op</code> between consecutive elements of this <code>NonEmptySet</code>, going right to left:
+    *
+    * <pre>
+    * op(x_1, op(x_2, ... op(x_{n-1}, x_n)...))
+    * </pre>
+    *
+    * <p>
+    * where x<sub>1</sub>, ..., x<sub>n</sub> are the elements of this <code>NonEmptySet</code>.
+    * </p>
+    */
+  def reduceRight[U >: T](op: (T, U) => U): U = toSet.reduceRight(op)
+
+  /**
+    * Applies a binary operator to all elements of this <code>NonEmptySet</code>, going right to left, returning the result in a <code>Some</code>.
+    *
+    * @tparam U the result of the binary operator
+    * @param op the binary operator
+    * @return a <code>Some</code> containing the result of <code>reduceRight(op)</code>
+    */
+  def reduceRightOption[U >: T](op: (T, U) => U): Option[U] = toSet.reduceRightOption(op)
+
+  /**
+    * Checks if the given <code>Iterable</code> contains the same elements in the same order as this <code>NonEmptySet</code>.
+    *
+    * @param that the <code>Iterable</code> with which to compare
+    * @return <code>true</code>, if both this <code>NonEmptySet</code> and the given <code>Iterable</code> contain the same elements
+    *     in the same order, <code>false</code> otherwise.
+    */
+  def sameElements[U >: T](that: Iterable[U]): Boolean = toSet == that.toSet
+
+  /**
+    * Checks if the given <code>Vector</code> contains the same elements in the same order as this <code>NonEmptySet</code>.
+    *
+    * @param that the <code>Vector</code> with which to compare
+    * @return <code>true</code>, if both this and the given <code>Vector</code> contain the same elements
+    *     in the same order, <code>false</code> otherwise.
+    */
+  def sameElements[U >: T](that: Vector[U]): Boolean = toSet == that.toSet
+
+  /**
+    * Checks if the given <code>NonEmptySet</code> contains the same elements in the same order as this <code>NonEmptySet</code>.
+    *
+    * @param that the <code>NonEmptySet</code> with which to compare
+    * @return <code>true</code>, if both this and the given <code>NonEmptySet</code> contain the same elements
+    *     in the same order, <code>false</code> otherwise.
+    */
+  def sameElements[U >: T](that: NonEmptySet[U]): Boolean = toSet == that.toSet
+
+  /**
+    * Computes a prefix scan of the elements of this <code>NonEmptySet</code>.
+    *
+    * <p>
+    * Note: The neutral element z may be applied more than once.
+    * </p>
+    *
+    * <p>
+    * Here are some examples:
+    * </p>
+    *
+    * <pre class="stHighlight">
+    * NonEmptySet(1, 2, 3).scan(0)(_ + _) == NonEmptySet(0, 1, 3, 6)
+    * NonEmptySet(1, 2, 3).scan("z")(_ + _.toString) == NonEmptySet("z", "z1", "z12", "z123")
+    * </pre>
+    *
+    * @tparam U a type parameter for the binary operator, a supertype of T, and the type of the resulting <code>NonEmptySet</code>.
+    * @param z a neutral element for the scan operation; may be added to the result an arbitrary number of
+    *     times, and must not change the result (<em>e.g.</em>, <code>Nil</code> for Set concatenation,
+    *     0 for addition, or 1 for multiplication.)
+    * @param op a binary operator that must be associative
+    * @return a new <code>NonEmptySet</code> containing the prefix scan of the elements in this <code>NonEmptySet</code>
+    */
+  def scan[U >: T](z: U)(op: (U, U) => U): NonEmptySet[U] = new NonEmptySet(toSet.scan(z)(op))
+
+  /**
+    * Produces a <code>NonEmptySet</code> containing cumulative results of applying the operator going left to right.
+    *
+    * <p>
+    * Here are some examples:
+    * </p>
+    *
+    * <pre class="stHighlight">
+    * NonEmptySet(1, 2, 3).scanLeft(0)(_ + _) == NonEmptySet(0, 1, 3, 6)
+    * NonEmptySet(1, 2, 3).scanLeft("z")(_ + _) == NonEmptySet("z", "z1", "z12", "z123")
+    * </pre>
+    *
+    * @tparam B the result type of the binary operator and type of the resulting <code>NonEmptySet</code>
+    * @param z the start value.
+    * @param op the binary operator.
+    * @return a new <code>NonEmptySet</code> containing the intermediate results of inserting <code>op</code> between consecutive elements of this <code>NonEmptySet</code>,
+    *     going left to right, with the start value, <code>z</code>, on the left.
+    */
+  def scanLeft[B](z: B)(op: (B, T) => B): NonEmptySet[B] = new NonEmptySet(toSet.scanLeft(z)(op))
+
+  /**
+    * Produces a <code>NonEmptySet</code> containing cumulative results of applying the operator going right to left.
+    *
+    * <p>
+    * Here are some examples:
+    * </p>
+    *
+    * <pre class="stHighlight">
+    * NonEmptySet(1, 2, 3).scanRight(0)(_ + _) == NonEmptySet(6, 5, 3, 0)
+    * NonEmptySet(1, 2, 3).scanRight("z")(_ + _) == NonEmptySet("123z", "23z", "3z", "z")
+    * </pre>
+    *
+    * @tparam B the result of the binary operator and type of the resulting <code>NonEmptySet</code>
+    * @param z the start value
+    * @param op the binary operator
+    * @return a new <code>NonEmptySet</code> containing the intermediate results of inserting <code>op</code> between consecutive elements of this <code>NonEmptySet</code>,
+    *     going right to left, with the start value, <code>z</code>, on the right.
+    */
+  def scanRight[B](z: B)(op: (T, B) => B): NonEmptySet[B] = new NonEmptySet(toSet.scanRight(z)(op))
+
+  /**
+    * Groups elements in fixed size blocks by passing a &ldquo;sliding window&rdquo; over them (as opposed to partitioning them, as is done in grouped.)
+    *
+    * @param size the number of elements per group
+    * @return an iterator producing <code>NonEmptySet</code>s of size <code>size</code>, except the last and the only element will be truncated
+    *     if there are fewer elements than <code>size</code>.
+    */
+  def sliding(size: Int): Iterator[NonEmptySet[T]] = toSet.sliding(size).map(new NonEmptySet(_))
+
+  /**
+    * Groups elements in fixed size blocks by passing a &ldquo;sliding window&rdquo; over them (as opposed to partitioning them, as is done in grouped.),
+    * moving the sliding window by a given <code>step</code> each time.
+    *
+    * @param size the number of elements per group
+    * @param step the distance between the first elements of successive groups
+    * @return an iterator producing <code>NonEmptySet</code>s of size <code>size</code>, except the last and the only element will be truncated
+    *     if there are fewer elements than <code>size</code>.
+    */
+  def sliding(size: Int, step: Int): Iterator[NonEmptySet[T]] = toSet.sliding(size, step).map(new NonEmptySet(_))
+
+  /**
+    * The size of this <code>NonEmptySet</code>.
+    *
+    * <p>
+    * Note: <code>length</code> and <code>size</code> yield the same result, which will be <code>&gt;</code>= 1.
+    * </p>
+    *
+    * @return the number of elements in this <code>NonEmptySet</code>.
+    */
+  def size: Int = toSet.size
+
+  /**
+    * Returns <code>"NonEmptySet"</code>, the prefix of this object's <code>toString</code> representation.
+    *
+    * @return the string <code>"NonEmptySet"</code>
+    */
+  def stringPrefix: String = "NonEmptySet"
+
+  /**
+    * The result of summing all the elements of this <code>NonEmptySet</code>.
+    *
+    * <p>
+    * This method can be invoked for any <code>NonEmptySet[T]</code> for which an implicit <code>Numeric[T]</code> exists.
+    * </p>
+    *
+    * @return the sum of all elements
+    */
+  def sum[U >: T](implicit num: Numeric[U]): U = toSet.sum(num)
+
+  /**
+    * Converts this <code>NonEmptySet</code> into a collection of type <code>Col</code> by copying all elements.
+    *
+    * @tparam C1 the collection type to build.
+    * @return a new collection containing all elements of this <code>NonEmptySet</code>.
+    */
+  def to[C1](factory: Factory[T, C1]): C1 = factory.fromSpecific(iterator)
+
+  /**
+    * Converts this <code>NonEmptySet</code> to an array.
+    *
+    * @return an array containing all elements of this <code>NonEmptySet</code>. A <code>ClassTag</code> must be available for the element type of this <code>NonEmptySet</code>.
+    */
+  def toArray[U >: T](implicit classTag: ClassTag[U]): Array[U] = toSet.toArray
+
+  /**
+    * Converts this <code>NonEmptySet</code> to a <code>Vector</code>.
+    *
+    * @return a <code>Vector</code> containing all elements of this <code>NonEmptySet</code>.
+    */
+  def toVector: Vector[T] = toSet.toVector
+
+  /**
+    * Converts this <code>NonEmptySet</code> to a mutable buffer.
+    *
+    * @return a buffer containing all elements of this <code>NonEmptySet</code>.
+    */
+  def toBuffer[U >: T]: Buffer[U] = toSet.toBuffer
+
+  /**
+    * Converts this <code>NonEmptySet</code> to an immutable <code>IndexedSeq</code>.
+    *
+    * @return an immutable <code>IndexedSeq</code> containing all elements of this <code>NonEmptySet</code>.
+    */
+  def toIndexedSeq: collection.immutable.IndexedSeq[T] = toSet.toVector
+
+  /**
+    * Converts this <code>NonEmptySet</code> to an iterable collection.
+    *
+    * @return an <code>Iterable</code> containing all elements of this <code>NonEmptySet</code>.
+    */
+  def toIterable: Iterable[T] = toSet
+
+  /**
+    * Returns an <code>Iterator</code> over the elements in this <code>NonEmptySet</code>.
+    *
+    * @return an <code>Iterator</code> containing all elements of this <code>NonEmptySet</code>.
+    */
+  def toIterator: Iterator[T] = toSet.iterator
+
+  /**
+    * Converts this <code>NonEmptySet</code> to a Set.
+    *
+    * @return a Set containing all elements of this <code>NonEmptySet</code>.
+    */
+  // def toSet: Set[T] = toSet
+
+  /**
+    * Converts this <code>NonEmptySet</code> to a map.
+    *
+    * <p>
+    * This method is unavailable unless the elements are members of <code>Tuple2</code>, each <code>((K, V))</code> becoming a key-value pair
+    * in the map. Duplicate keys will be overwritten by later keys.
+    * </p>
+    *
+    * @return a map of type <code>immutable.Map[K, V]</code> containing all key/value pairs of type <code>(K, V)</code> of this <code>NonEmptySet</code>.
+    */
+  def toMap[K, V](implicit ev: T <:< (K, V)): Map[K, V] = toSet.toMap
+
+  /**
+    * Converts this <code>NonEmptySet</code> to an immutable <code>IndexedSeq</code>.
+    *
+    * @return an immutable <code>IndexedSeq</code> containing all elements of this <code>NonEmptySet</code>.
+    */
+  def toSeq: Seq[T] = toSet.toSeq
+
+  /**
+    * Converts this <code>NonEmptySet</code> to a set.
+    *
+    * @return a set containing all elements of this <code>NonEmptySet</code>.
+    */
+  def toList: collection.immutable.List[T] = toSet.toList
+
+  /**
+    * Returns a string representation of this <code>NonEmptySet</code>.
+    *
+    * @return the string <code>"NonEmptySet"</code> followed by the result of invoking <code>toString</code> on
+    *   this <code>NonEmptySet</code>'s elements, surrounded by parentheses.
+    */
+  override def toString: String = "NonEmptySet(" + toSet.mkString(", ") + ")"
+
+  def transpose[U](implicit ev: T <:< NonEmptySet[U]): NonEmptySet[NonEmptySet[U]] = {
+    val asSets = toSet.map(ev)
+    val Set = asSets.map(_.toSet).transpose
+    new NonEmptySet(Set.map(new NonEmptySet(_)))
+  }
+
+  /**
+    * Produces a new <code>NonEmptySet</code> that contains all elements of this <code>NonEmptySet</code> and also all elements of a given <code>Vector</code>.
+    *
+    * <p>
+    * <code>NonEmptySetX</code> <code>union</code> <code>everyY</code> is equivalent to <code>NonEmptySetX</code> <code>++</code> <code>everyY</code>.
+    * </p>
+    *
+    * <p>
+    * Another way to express this is that <code>NonEmptySetX</code> <code>union</code> <code>everyY</code> computes the order-presevring multi-set union
+    * of <code>NonEmptySetX</code> and <code>everyY</code>. This <code>union</code> method is hence a counter-part of <code>diff</code> and <code>intersect</code> that
+    * also work on multi-sets.
+    * </p>
+    *
+    * @param that the <code>Vector</code> to add.
+    * @return a new <code>NonEmptySet</code> that contains all elements of this <code>NonEmptySet</code> followed by all elements of <code>that</code> <code>Vector</code>.
+    */
+  def union(that: Vector[T]): NonEmptySet[T] = new NonEmptySet(toSet union that.toSet)
+
+  /**
+    * Produces a new <code>NonEmptySet</code> that contains all elements of this <code>NonEmptySet</code> and also all elements of a given <code>NonEmptySet</code>.
+    *
+    * <p>
+    * <code>NonEmptySetX</code> <code>union</code> <code>NonEmptySetY</code> is equivalent to <code>NonEmptySetX</code> <code>++</code> <code>NonEmptySetY</code>.
+    * </p>
+    *
+    * <p>
+    * Another way to express this is that <code>NonEmptySetX</code> <code>union</code> <code>NonEmptySetY</code> computes the order-presevring multi-set union
+    * of <code>NonEmptySetX</code> and <code>NonEmptySetY</code>. This <code>union</code> method is hence a counter-part of <code>diff</code> and <code>intersect</code> that
+    * also work on multi-sets.
+    * </p>
+    *
+    * @param that the <code>NonEmptySet</code> to add.
+    * @return a new <code>NonEmptySet</code> that contains all elements of this <code>NonEmptySet</code> followed by all elements of <code>that</code>.
+    */
+  def union(that: NonEmptySet[T]): NonEmptySet[T] = new NonEmptySet(toSet union that.toSet)
+
+  /**
+    * Produces a new <code>NonEmptySet</code> that contains all elements of this <code>NonEmptySet</code> and also all elements of a given <code>GenSeq</code>.
+    *
+    * <p>
+    * <code>NonEmptySetX</code> <code>union</code> <code>ys</code> is equivalent to <code>NonEmptySetX</code> <code>++</code> <code>ys</code>.
+    * </p>
+    *
+    * <p>
+    * Another way to express this is that <code>NonEmptySetX</code> <code>union</code> <code>ys</code> computes the order-presevring multi-set union
+    * of <code>NonEmptySetX</code> and <code>ys</code>. This <code>union</code> method is hence a counter-part of <code>diff</code> and <code>intersect</code> that
+    * also work on multi-sets.
+    * </p>
+    *
+    * @param that the <code>Set</code> to add.
+    * @return a new <code>NonEmptySet</code> that contains all elements of this <code>NonEmptySet</code> followed by all elements of <code>that</code> <code>GenSeq</code>.
+    */
+  def union(that: Set[T])(implicit dummyImplicit: DummyImplicit): NonEmptySet[T] = new NonEmptySet(toSet.union(that))
+
+  /**
+    * Converts this <code>NonEmptySet</code> of pairs into two <code>NonEmptySet</code>s of the first and second half of each pair.
+    *
+    * @tparam L the type of the first half of the element pairs
+    * @tparam R the type of the second half of the element pairs
+    * @param asPair an implicit conversion that asserts that the element type of this <code>NonEmptySet</code> is a pair.
+    * @return a pair of <code>NonEmptySet</code>s, containing the first and second half, respectively, of each element pair of this <code>NonEmptySet</code>.
+    */
+  def unzip[L, R](implicit asPair: T => (L, R)): (NonEmptySet[L], NonEmptySet[R]) = {
+    val unzipped = toSet.unzip
+    (new NonEmptySet(unzipped._1), new NonEmptySet(unzipped._2))
+  }
+
+  /**
+    * Converts this <code>NonEmptySet</code> of triples into three <code>NonEmptySet</code>s of the first, second, and and third element of each triple.
+    *
+    * @tparam L the type of the first member of the element triples
+    * @tparam M the type of the second member of the element triples
+    * @tparam R the type of the third member of the element triples
+    * @param asTriple an implicit conversion that asserts that the element type of this <code>NonEmptySet</code> is a triple.
+    * @return a triple of <code>NonEmptySet</code>s, containing the first, second, and third member, respectively, of each element triple of this <code>NonEmptySet</code>.
+    */
+  def unzip3[L, M, R](implicit asTriple: T => (L, M, R)): (NonEmptySet[L], NonEmptySet[M], NonEmptySet[R]) = {
+    val unzipped = toSet.unzip3
+    (new NonEmptySet(unzipped._1), new NonEmptySet(unzipped._2), new NonEmptySet(unzipped._3))
+  }
+
+  /**
+    * Returns a <code>NonEmptySet</code> formed from this <code>NonEmptySet</code> and an iterable collection by combining corresponding
+    * elements in pairs. If one of the two collections is shorter than the other, placeholder elements will be used to extend the
+    * shorter collection to the length of the longer.
+    *
+    * @tparm O the type of the second half of the returned pairs
+    * @tparm U the type of the first half of the returned pairs
+    * @param other the <code>Iterable</code> providing the second half of each result pair
+    * @param thisElem the element to be used to fill up the result if this <code>NonEmptySet</code> is shorter than <code>that</code> <code>Iterable</code>.
+    * @param otherElem the element to be used to fill up the result if <code>that</code> <code>Iterable</code> is shorter than this <code>NonEmptySet</code>.
+    * @return a new <code>NonEmptySet</code> containing pairs consisting of corresponding elements of this <code>NonEmptySet</code> and <code>that</code>. The
+    *     length of the returned collection is the maximum of the lengths of this <code>NonEmptySet</code> and <code>that</code>. If this <code>NonEmptySet</code>
+    *     is shorter than <code>that</code>, <code>thisElem</code> values are used to pad the result. If <code>that</code> is shorter than this
+    *     <code>NonEmptySet</code>, <code>thatElem</code> values are used to pad the result.
+    */
+  def zipAll[O, U >: T](other: collection.Iterable[O], thisElem: U, otherElem: O): NonEmptySet[(U, O)] =
+    new NonEmptySet(toSet.zipAll(other, thisElem, otherElem))
+
+  /**
+    * Zips this <code>NonEmptySet</code>  with its indices.
+    *
+    * @return A new <code>NonEmptySet</code> containing pairs consisting of all elements of this <code>NonEmptySet</code> paired with their index. Indices start at 0.
+    */
+  def zipWithIndex: NonEmptySet[(T, Int)] = new NonEmptySet(toSet.zipWithIndex)
+}
+
+/**
+  * Companion object for class <code>NonEmptySet</code>.
+  */
+object NonEmptySet {
+
+  /**
+    * Constructs a new <code>NonEmptySet</code> given at least one element.
+    *
+    * @tparam T the type of the element contained in the new <code>NonEmptySet</code>
+    * @param firstElement the first element (with index 0) contained in this <code>NonEmptySet</code>
+    * @param otherElements a varargs of zero or more other elements (with index 1, 2, 3, ...) contained in this <code>NonEmptySet</code>
+    */
+  def apply[T](firstElement: T, otherElements: T*): NonEmptySet[T] = new NonEmptySet(otherElements.toSet + firstElement)
+
+  /**
+    * Variable argument extractor for <code>NonEmptySet</code>s.
+    *
+    * @param nonEmptySet: the <code>NonEmptySet</code> containing the elements to extract
+    * @return an <code>Seq</code> containing this <code>NonEmptySet</code>s elements, wrapped in a <code>Some</code>
+    */
+  def unapplySeq[T](nonEmptySet: NonEmptySet[T]): Option[Seq[T]] = Some(nonEmptySet.toSeq)
+
+  /*
+    // TODO: Figure out how to get case NonEmptySet() to not compile
+    def unapplySeq[T](NonEmptySet: NonEmptySet[T]): Option[(T, Seq[T])] = Some(NonEmptySet.head, NonEmptySet.tail)
+  */
+
+  /**
+    * Optionally construct a <code>NonEmptySet</code> containing the elements, if any, of a given <code>Set</code>.
+    *
+    * @param set the <code>Set</code> with which to construct a <code>NonEmptySet</code>
+    * @return a <code>NonEmptySet</code> containing the elements of the given <code>GenSeq</code>, if non-empty, wrapped in
+    *     a <code>Some</code>; else <code>None</code> if the <code>GenSeq</code> is empty
+    */
+  def from[T](set: Set[T]): Option[NonEmptySet[T]] =
+    set.headOption match {
+      case None => None
+      case Some(_) => Some(new NonEmptySet(scala.collection.immutable.Set.empty[T] ++ set))
+    }
+
+}
+
diff --git a/fundamentals/fundamentals-collections/src/main/scala/izumi/fundamentals/collections/nonempty/NonEmptyString.scala b/fundamentals/fundamentals-collections/src/main/scala/izumi/fundamentals/collections/nonempty/NonEmptyString.scala
new file mode 100644
index 000000000..60e02348a
--- /dev/null
+++ b/fundamentals/fundamentals-collections/src/main/scala/izumi/fundamentals/collections/nonempty/NonEmptyString.scala
@@ -0,0 +1,1541 @@
+package izumi.fundamentals.collections.nonempty
+
+
+import scala.collection.compat.{Factory, _}
+import scala.collection.mutable.{ArrayBuffer, Buffer}
+import scala.collection.{Iterable, Seq}
+import scala.reflect.ClassTag
+
+
+// Can't be a LinearSeq[T] because Builder would be able to create an empty one.
+/**
+  * A non-empty list: an ordered, immutable, non-empty collection of elements with <code>LinearSeq</code> performance characteristics.
+  *
+  * <p>
+  * The purpose of <code>NonEmptyString</code> is to allow you to express in a type that a <code>String</code> is non-empty, thereby eliminating the
+  * need for (and potential exception from) a run-time check for non-emptiness. For a non-empty sequence with <code>IndexedSeq</code>
+  * performance, see <a href="Vector.html"><code>Vector</code></a>.
+  * </p>
+  *
+  * <h2>Constructing <code>NonEmptyString</code>s</h2>
+  *
+  * <p>
+  * You can construct a <code>NonEmptyString</code> by passing one or more elements to the <code>NonEmptyString.apply</code> factory method:
+  * </p>
+  *
+  * <pre class="stHighlight">
+  * scala&gt; NonEmptyString(1, 2, 3)
+  * res0: org.scalactic.anyvals.NonEmptyString[Int] = NonEmptyString(1, 2, 3)
+  * </pre>
+  *
+  * <p>
+  * Alternatively you can <em>cons</em> elements onto the <code>End</code> singleton object, similar to making a <code>String</code> starting with <code>Nil</code>:
+  * </p>
+  *
+  * <pre class="stHighlight">
+  * scala&gt; 1 :: 2 :: 3 :: Nil
+  * res0: String[Int] = String(1, 2, 3)
+  *
+  * scala&gt; 1 :: 2 :: 3 :: End
+  * res1: org.scalactic.NonEmptyString[Int] = NonEmptyString(1, 2, 3)
+  * </pre>
+  *
+  * <p>
+  * Note that although <code>Nil</code> is a <code>String[Nothing]</code>, <code>End</code> is
+  * not a <code>NonEmptyString[Nothing]</code>, because no empty <code>NonEmptyString</code> exists. (A non-empty list is a series
+  * of connected links; if you have no links, you have no non-empty list.)
+  * </p>
+  *
+  * <pre class="stHighlight">
+  * scala&gt; val nil: String[Nothing] = Nil
+  * nil: String[Nothing] = String()
+  *
+  * scala&gt; val nada: NonEmptyString[Nothing] = End
+  * &lt;console&gt;:16: error: type mismatch;
+  * found   : org.scalactic.anyvals.End.type
+  * required: org.scalactic.anyvals.NonEmptyString[Nothing]
+  *        val nada: NonEmptyString[Nothing] = End
+  *                                          ^
+  * </pre>
+  *
+  * <h2>Working with <code>NonEmptyString</code>s</h2>
+  *
+  * <p>
+  * <code>NonEmptyString</code> does not extend Scala's <code>Seq</code> or <code>Traversable</code> traits because these require that
+  * implementations may be empty. For example, if you invoke <code>tail</code> on a <code>Seq</code> that contains just one element,
+  * you'll get an empty <code>Seq</code>:
+  * </p>
+  *
+  * <pre class="stREPL">
+  * scala&gt; String(1).tail
+  * res6: String[Int] = String()
+  * </pre>
+  *
+  * <p>
+  * On the other hand, many useful methods exist on <code>Seq</code> that when invoked on a non-empty <code>Seq</code> are guaranteed
+  * to not result in an empty <code>Seq</code>. For convenience, <code>NonEmptyString</code> defines a method corresponding to every such <code>Seq</code>
+  * method. Here are some examples:
+  * </p>
+  *
+  * <pre class="stHighlight">
+  * NonEmptyString(1, 2, 3).map(_ + 1)                        // Result: NonEmptyString(2, 3, 4)
+  * NonEmptyString(1).map(_ + 1)                              // Result: NonEmptyString(2)
+  * NonEmptyString(1, 2, 3).containsSlice(NonEmptyString(2, 3)) // Result: true
+  * NonEmptyString(1, 2, 3).containsSlice(NonEmptyString(3, 4)) // Result: false
+  * NonEmptyString(-1, -2, 3, 4, 5).minBy(_.abs)              // Result: -1
+  * </pre>
+  *
+  * <p>
+  * <code>NonEmptyString</code> does <em>not</em> currently define any methods corresponding to <code>Seq</code> methods that could result in
+  * an empty <code>Seq</code>. However, an implicit converison from <code>NonEmptyString</code> to <code>String</code>
+  * is defined in the <code>NonEmptyString</code> companion object that will be applied if you attempt to call one of the missing methods. As a
+  * result, you can invoke <code>filter</code> on an <code>NonEmptyString</code>, even though <code>filter</code> could result
+  * in an empty sequence&mdash;but the result type will be <code>String</code> instead of <code>NonEmptyString</code>:
+  * </p>
+  *
+  * <pre class="stHighlight">
+  * NonEmptyString(1, 2, 3).filter(_ &lt; 10) // Result: String(1, 2, 3)
+  * NonEmptyString(1, 2, 3).filter(_ &gt; 10) // Result: String()
+  * </pre>
+  *
+  *
+  * <p>
+  * You can use <code>NonEmptyString</code>s in <code>for</code> expressions. The result will be an <code>NonEmptyString</code> unless
+  * you use a filter (an <code>if</code> clause). Because filters are desugared to invocations of <code>filter</code>, the
+  * result type will switch to a <code>String</code> at that point. Here are some examples:
+  * </p>
+  *
+  * <pre class="stREPL">
+  * scala&gt; import org.scalactic.anyvals._
+  * import org.scalactic.anyvals._
+  *
+  * scala&gt; for (i &lt;- NonEmptyString(1, 2, 3)) yield i + 1
+  * res0: org.scalactic.anyvals.NonEmptyString[Int] = NonEmptyString(2, 3, 4)
+  *
+  * scala&gt; for (i &lt;- NonEmptyString(1, 2, 3) if i &lt; 10) yield i + 1
+  * res1: String[Int] = String(2, 3, 4)
+  *
+  * scala&gt; for {
+  *      |   i &lt;- NonEmptyString(1, 2, 3)
+  *      |   j &lt;- NonEmptyString('a', 'b', 'c')
+  *      | } yield (i, j)
+  * res3: org.scalactic.anyvals.NonEmptyString[(Int, Char)] =
+  *         NonEmptyString((1,a), (1,b), (1,c), (2,a), (2,b), (2,c), (3,a), (3,b), (3,c))
+  *
+  * scala&gt; for {
+  *      |   i &lt;- NonEmptyString(1, 2, 3) if i &lt; 10
+  *      |   j &lt;- NonEmptyString('a', 'b', 'c')
+  *      | } yield (i, j)
+  * res6: String[(Int, Char)] =
+  *         String((1,a), (1,b), (1,c), (2,a), (2,b), (2,c), (3,a), (3,b), (3,c))
+  * </pre>
+  *
+  */
+final class NonEmptyString private (val theString: String) extends AnyVal {
+
+  /**
+    * Returns a new <code>NonEmptyString</code> containing this <code>NonEmptyString</code> followed by the passed <code>NonEmptyString</code>.
+    *
+    * @param other the <code>NonEmptyString</code> to append
+    * @return a new <code>NonEmptyString</code> that contains this <code>NonEmptyString</code> followed by <code>other</code>.
+    */
+  def ++(other: NonEmptyString): NonEmptyString = new NonEmptyString(theString ++ other.theString)
+
+  /**
+    * Returns a new <code>NonEmptyString</code> containing this <code>NonEmptyString</code> followed by the characters of the passed <code>Vector</code>.
+    *
+    * @param other the <code>Vector</code> of <code>Char</code> to append
+    * @return a new <code>NonEmptyString</code> that contains this <code>NonEmptyString</code> followed by all characters of <code>other</code>.
+    */
+  def ++(other: Vector[Char]): NonEmptyString = new NonEmptyString(theString ++ other.mkString)
+
+  // TODO: Have I added these extra ++, etc. methods to Vector that take a NonEmptyString?
+
+  /**
+    * Returns a new <code>NonEmptyString</code> containing this <code>NonEmptyString</code> followed by the characters of the passed <code>TraversableOnce</code>.
+    *
+    * @param other the <code>TraversableOnce</code> of <code>Char</code> to append
+    * @return a new <code>NonEmptyString</code> that contains this <code>NonEmptyString</code> followed by all characters of <code>other</code>.
+    */
+  def ++(other: IterableOnce[Char]): NonEmptyString =
+    if (other.iterator.isEmpty) this else new NonEmptyString(theString ++ other.iterator.mkString)
+
+  /**
+    * Returns a new <code>NonEmptyString</code> with the given character prepended.
+    *
+    * <p>
+    * Note that :-ending operators are right associative. A mnemonic for <code>+:</code> <em>vs.</em> <code>:+</code> is: the COLon goes on the COLlection side.
+    * </p>
+    *
+    * @param c the character to prepend to this <code>NonEmptyString</code>
+    * @return a new <code>NonEmptyString</code> consisting of <code>c</code> followed by all characters of this <code>NonEmptyString</code>.
+    */
+  def +:(c: Char): NonEmptyString = new NonEmptyString(c +: theString)
+
+  /**
+    * Returns a new <code>NonEmptyString</code> with the given character appended.
+    *
+    * <p>
+    * Note a mnemonic for <code>+:</code> <em>vs.</em> <code>:+</code> is: the COLon goes on the COLlection side.
+    * </p>
+    *
+    * @param c the character to append to this <code>NonEmptyString</code>
+    * @return a new <code>NonEmptyString</code> consisting of all characters of this <code>NonEmptyString</code> followed by the given <code>c</code>.
+    */
+  def :+(c: Char): NonEmptyString = new NonEmptyString(theString :+ c)
+
+  /**
+    * Appends all characters of this <code>NonEmptyString</code> to a string builder. The written text will consist of a concatenation of the result of invoking <code>toString</code>
+    * on of every element of this <code>NonEmptyString</code>, without any separator string.
+    *
+    * @param sb the string builder to which characters will be appended
+    * @return the string builder, <code>sb</code>, to which elements were appended.
+    */
+  def addString(sb: StringBuilder): StringBuilder = theString.addString(sb)
+
+  /**
+    * Appends all characters of this <code>NonEmptyString</code> to a string builder using a separator string. The written text will consist of a concatenation of the
+    * result of invoking <code>toString</code>
+    * on of every character of this <code>NonEmptyString</code>, separated by the string <code>sep</code>.
+    *
+    * @param sb the string builder to which characters will be appended
+    * @param sep the separator string
+    * @return the string builder, <code>sb</code>, to which characters were appended.
+    */
+  def addString(sb: StringBuilder, sep: String): StringBuilder = theString.addString(sb, sep)
+
+  /**
+    * Appends all characters of this <code>NonEmptyString</code> to a string builder using start, end, and separator strings. The written text will consist of a concatenation of
+    * the string <code>start</code>; the result of invoking <code>toString</code> on all characters of this <code>NonEmptyString</code>,
+    * separated by the string <code>sep</code>; and the string <code>end</code>
+    *
+    * @param sb the string builder to which characters will be appended
+    * @param start the starting string
+    * @param sep the separator string
+    * @param end the ending string
+    * @return the string builder, <code>sb</code>, to which characters were appended.
+    */
+  def addString(sb: StringBuilder, start: String, sep: String, end: String): StringBuilder = theString.addString(sb, start, sep, end)
+
+  /**
+    * Selects a character by its index in the <code>NonEmptyString</code>.
+    *
+    * @return the character of this <code>NonEmptyString</code> at index <code>idx</code>, where 0 indicates the first element.
+    */
+  def apply(idx: Int): Char = theString(idx)
+
+  /**
+    * Gets a character by its index in the <code>NonEmptyString</code>.
+    *
+    * @return the character of this <code>NonEmptyString</code> at index <code>idx</code>, where 0 indicates the first element.
+    */
+  def charAt(idx: Int): Char = theString.charAt(idx)
+
+  /**
+    * Finds the first character of this <code>NonEmptyString</code> for which the given partial function is defined, if any, and applies the partial function to it.
+    *
+    * @param pf the partial function
+    * @return an <code>Option</code> containing <code>pf</code> applied to the first character for which it is defined, or <code>None</code> if
+    *    the partial function was not defined for any character.
+    */
+  def collectFirst[U](pf: PartialFunction[Char, U]): Option[U] = theString.collectFirst(pf)
+
+  /**
+    * Indicates whether this <code>NonEmptyString</code> contains a given value as an character.
+    *
+    * @param c the element to look for
+    * @return true if this <code>NonEmptyString</code> has an character that is equal (as determined by <code>==)</code> to <code>c</code>, false otherwise.
+    */
+  def contains(c: Char): Boolean = theString.contains(c)
+
+  /**
+    * Indicates whether this <code>NonEmptyString</code> contains a given <code>Seq</code> of characters as a slice.
+    *
+    * @param that the <code>Seq</code> character slice to look for
+    * @return true if this <code>NonEmptyString</code> contains a slice with the same characters as <code>that</code>, otherwise <code>false</code>.
+    */
+  def containsSlice(that: Seq[Char]): Boolean = theString.containsSlice(that)
+
+  /**
+    * Indicates whether this <code>NonEmptyString</code> contains a given <code>Vector</code> of character as a slice.
+    *
+    * @param that the <code>Vector</code> character slice to look for
+    * @return true if this <code>NonEmptyString</code> contains a character slice with the same characters as <code>that</code>, otherwise <code>false</code>.
+    */
+  def containsSlice(that: Vector[Char]): Boolean = theString.containsSlice(that)
+
+  /**
+    * Indicates whether this <code>NonEmptyString</code> contains a given <code>NonEmptyString</code> as a slice.
+    *
+    * @param that the <code>NonEmptyString</code> slice to look for
+    * @return true if this <code>NonEmptyString</code> contains a slice with the same characters as <code>that</code>, otherwise <code>false</code>.
+    */
+  def containsSlice(that: NonEmptyString): Boolean = theString.containsSlice(that.theString)
+
+  /**
+    * Copies characters of this <code>NonEmptyString</code> to an array. Fills the given array <code>arr</code> with characters of this <code>NonEmptyString</code>. Copying
+    * will stop once either the end of the current <code>NonEmptyString</code> is reached, or the end of the array is reached.
+    *
+    * @param arr the array to fill
+    */
+  def copyToArray(arr: Array[Char]): Unit = {
+    theString.copyToArray(arr, 0)
+    ()
+  }
+
+  /**
+    * Copies characters of this <code>NonEmptyString</code> to an array. Fills the given array <code>arr</code> with characters of this <code>NonEmptyString</code>, beginning at
+    * index <code>start</code>. Copying will stop once either the end of the current <code>NonEmptyString</code> is reached, or the end of the array is reached.
+    *
+    * @param arr the array to fill
+    * @param start the starting index
+    */
+  def copyToArray(arr: Array[Char], start: Int): Unit = {
+    theString.copyToArray(arr, start)
+    ()
+  }
+
+  /**
+    * Copies characters of this <code>NonEmptyString</code> to an array. Fills the given array <code>arr</code> with at most <code>len</code> characters of this <code>NonEmptyString</code>, beginning at
+    * index <code>start</code>. Copying will stop once either the end of the current <code>NonEmptyString</code> is reached, the end of the array is reached, or
+    * <code>len</code> elements have been copied.
+    *
+    * @param arr the array to fill
+    * @param start the starting index
+    * @param len the maximum number of elements to copy
+    */
+  def copyToArray(arr: Array[Char], start: Int, len: Int): Unit = {
+    theString.copyToArray(arr, start, len)
+    ()
+  }
+
+  /**
+    * Copies all characters of this <code>NonEmptyString</code> to a buffer.
+    *
+    * @param buf the buffer to which characters are copied
+    */
+  def copyToBuffer(buf: Buffer[Char]): Unit = {
+    buf ++= theString
+    ()
+  }
+
+  /**
+    * Indicates whether every character of this <code>NonEmptyString</code> relates to the corresponding element of a given <code>Seq</code> by satisfying a given predicate.
+    *
+    * @tparam B the type of the elements of <code>that</code>
+    * @param that the <code>Seq</code> to compare for correspondence
+    * @param p the predicate, which relates elements from this <code>NonEmptyString</code> and the passed <code>Seq</code>
+    * @return true if this <code>NonEmptyString</code> and the passed <code>Seq</code> have the same length and <code>p(x, y)</code> is <code>true</code>
+    *     for all corresponding elements <code>x</code> of this <code>NonEmptyString</code> and <code>y</code> of that, otherwise <code>false</code>.
+    */
+  def corresponds[B](that: Seq[B])(p: (Char, B) => Boolean): Boolean = theString.corresponds(that)(p)
+
+  /**
+    * Indicates whether every character of this <code>NonEmptyString</code> relates to the corresponding element of a given <code>Vector</code> by satisfying a given predicate.
+    *
+    * @tparam B the type of the elements of <code>that</code>
+    * @param that the <code>Vector</code> to compare for correspondence
+    * @param p the predicate, which relates elements from this <code>NonEmptyString</code> and the passed <code>Vector</code>
+    * @return true if this <code>NonEmptyString</code> and the passed <code>Vector</code> have the same length and <code>p(x, y)</code> is <code>true</code>
+    *     for all corresponding elements <code>x</code> of this <code>NonEmptyString</code> and <code>y</code> of that, otherwise <code>false</code>.
+    */
+  def corresponds[B](that: Vector[B])(p: (Char, B) => Boolean): Boolean = theString.corresponds(that)(p)
+
+  /**
+    * Indicates whether every character of this <code>NonEmptyString</code> relates to the corresponding character of a given <code>NonEmptyString</code> by satisfying a given predicate.
+    *
+    * @param that the <code>NonEmptyString</code> to compare for correspondence
+    * @param p the predicate, which relates elements from this and the passed <code>NonEmptyString</code>
+    * @return true if this and the passed <code>NonEmptyString</code> have the same length and <code>p(x, y)</code> is <code>true</code>
+    *     for all corresponding characters <code>x</code> of this <code>NonEmptyString</code> and <code>y</code> of that, otherwise <code>false</code>.
+    */
+  def corresponds(that: NonEmptyString)(p: (Char, Char) => Boolean): Boolean = theString.corresponds(that.theString)(p)
+
+  /**
+    * Counts the number of characters in this <code>NonEmptyString</code> that satisfy a predicate.
+    *
+    * @param p the predicate used to test characters.
+    * @return the number of characters satisfying the predicate <code>p</code>.
+    */
+  def count(p: Char => Boolean): Int = theString.count(p)
+
+  /**
+    * Builds a new <code>NonEmptyString</code> from this <code>NonEmptyString</code> without any duplicate characters.
+    *
+    * @return A new <code>NonEmptyString</code> that contains the first occurrence of every character of this <code>NonEmptyString</code>.
+    */
+  def distinct: NonEmptyString = new NonEmptyString(theString.iterator.toSeq.distinct.mkString)
+
+  /**
+    * Indicates whether this <code>NonEmptyString</code> ends with the given <code>Seq</code> of Char.
+    *
+    * @param that the sequence to test
+    * @return <code>true</code> if this <code>NonEmptyString</code> has <code>that</code> as a suffix, <code>false</code> otherwise. 
+    */
+  def endsWith[B](that: Seq[B]): Boolean = theString.toSeq.endsWith[Any](that)
+
+  /**
+    * Indicates whether this <code>NonEmptyString</code> ends with the given <code>Vector</code>.
+    *
+    * @param that the <code>Vector</code> to test
+    * @return <code>true</code> if this <code>NonEmptyString</code> has <code>that</code> as a suffix, <code>false</code> otherwise. 
+    */
+  def endsWith[B](that: Vector[B]): Boolean = theString.toSeq.endsWith[Any](that)
+
+  // TODO: Search for that: Vector in here and add a that: NonEmptyString in Vector.
+  /**
+    * Indicates whether this <code>NonEmptyString</code> ends with the given <code>NonEmptyString</code>.
+    *
+    * @param that the <code>NonEmptyString</code> to test
+    * @return <code>true</code> if this <code>NonEmptyString</code> has <code>that</code> as a suffix, <code>false</code> otherwise. 
+    */
+  def endsWith(that: NonEmptyString): Boolean = theString.toSeq.endsWith[Any](that.theString)
+
+  /*
+    override def equals(o: Any): Boolean =
+      o match {
+        case nonEmptyString: NonEmptyString[_] => toString == nonEmptyString.toString
+        case _ => false
+      }
+  */
+
+  /**
+    * Indicates whether a predicate holds for at least one of the characters of this <code>NonEmptyString</code>.
+    *
+    * @param p the predicate used to test characters.
+    * @return <code>true</code> if the given predicate <code>p</code> holds for some of the elements of this <code>NonEmptyString</code>, otherwise <code>false</code>. 
+    */
+  def exists(p: Char => Boolean): Boolean = theString.exists(p)
+
+  /**
+    * Finds the first character of this <code>NonEmptyString</code> that satisfies the given predicate, if any.
+    *
+    * @param p the predicate used to test characters
+    * @return an <code>Some</code> containing the first character in this <code>NonEmptyString</code> that satisfies <code>p</code>, or <code>None</code> if none exists.
+    */
+  def find(p: Char => Boolean): Option[Char] = theString.find(p)
+
+  /**
+    * Builds a new <code>NonEmptyString</code> by applying a function to all characters of this <code>NonEmptyString</code> and using the characters of the resulting <code>NonEmptyString</code>s.
+    *
+    * @param f the function to apply to each character.
+    * @return a new <code>NonEmptyString</code> containing characters obtained by applying the given function <code>f</code> to each character of this <code>NonEmptyString</code> and concatenating
+    *    the characters of resulting <code>NonEmptyString</code>s.
+    */
+  def flatMap(f: Char => NonEmptyString): NonEmptyString = {
+    val buf = new ArrayBuffer[Char]
+    for (c <- theString)
+      buf ++= f(c).theString
+    new NonEmptyString(buf.mkString)
+  }
+
+  /**
+    * Folds the characters of this <code>NonEmptyString</code> using the specified associative binary operator.
+    *
+    * <p>
+    * The order in which operations are performed on characters is unspecified and may be nondeterministic.
+    * </p>
+    *
+    * @param z a neutral character for the fold operation; may be added to the result an arbitrary number of
+    *     times, and must not change the result (<em>e.g.</em>, <code>Nil</code> for list concatenation,
+    *     0 for addition, or 1 for multiplication.)
+    * @param op a binary operator that must be associative
+    * @return the result of applying fold operator <code>op</code> between all the elements and <code>z</code>
+    */
+  def fold(z: Char)(op: (Char, Char) => Char): Char = theString.fold(z)(op)
+
+  /**
+    * Applies a binary operator to a start value and all characters of this <code>NonEmptyString</code>, going left to right.
+    *
+    * @tparam B the result type of the binary operator.
+    * @param z the start value.
+    * @param op the binary operator.
+    * @return the result of inserting <code>op</code> between consecutive characters of this <code>NonEmptyString</code>, going left to right, with the start value,
+    *     <code>z</code>, on the left:
+    *
+    * <pre>
+    * op(...op(op(z, x_1), x_2), ..., x_n)
+    * </pre>
+    *
+    * <p>
+    * where x<sub>1</sub>, ..., x<sub>n</sub> are the elements of this <code>NonEmptyString</code>. 
+    * </p>
+    */
+  def foldLeft[B](z: B)(op: (B, Char) => B): B = theString.foldLeft(z)(op)
+
+  /**
+    * Applies a binary operator to all characters of this <code>NonEmptyString</code> and a start value, going right to left.
+    *
+    * @tparam B the result of the binary operator
+    * @param z the start value
+    * @param op the binary operator
+    * @return the result of inserting <code>op</code> between consecutive characters of this <code>NonEmptyString</code>, going right to left, with the start value,
+    *     <code>z</code>, on the right:
+    *
+    * <pre>
+    * op(x_1, op(x_2, ... op(x_n, z)...))
+    * </pre>
+    *
+    * <p>
+    * where x<sub>1</sub>, ..., x<sub>n</sub> are the elements of this <code>NonEmptyString</code>. 
+    * </p>
+    */
+  def foldRight[B](z: B)(op: (Char, B) => B): B = theString.foldRight(z)(op)
+
+  /**
+    * Indicates whether a predicate holds for all characters of this <code>NonEmptyString</code>.
+    *
+    * @param p the predicate used to test characters.
+    * @return <code>true</code> if the given predicate <code>p</code> holds for all characters of this <code>NonEmptyString</code>, otherwise <code>false</code>.
+    */
+  def forall(p: Char => Boolean): Boolean = theString.forall(p)
+
+  /**
+    * Applies a function <code>f</code> to all characters of this <code>NonEmptyString</code>.
+    *
+    * @param f the function that is applied for its side-effect to every character. The result of function <code>f</code> is discarded.
+    */
+  def foreach(f: Char => Unit): Unit = theString.foreach(f)
+
+  /**
+    * Partitions this <code>NonEmptyString</code> into a map of <code>NonEmptyString</code>s according to some discriminator function.
+    *
+    * @tparam K the type of keys returned by the discriminator function.
+    * @param f the discriminator function.
+    * @return A map from keys to <code>NonEmptyString</code>s such that the following invariant holds:
+    *
+    * <pre>
+    * (nonEmptyString.toString partition f)(k) = xs filter (x =&gt; f(x) == k)
+    * </pre>
+    *
+    * <p>
+    * That is, every key <code>k</code> is bound to a <code>NonEmptyString</code> of those elements <code>x</code> for which <code>f(x)</code> equals <code>k</code>.
+    * </p>
+    */
+  def groupBy[K](f: Char => K): Map[K, NonEmptyString] = {
+    val mapKToString = theString.iterator.toSeq.groupBy(f)
+    mapKToString.view.mapValues { list => new NonEmptyString(list.mkString) }.toMap
+  }
+
+  /**
+    * Partitions characters into fixed size <code>NonEmptyString</code>s.
+    *
+    * @param size the number of characters per group
+    * @return An iterator producing <code>NonEmptyString</code>s of size <code>size</code>, except the last will be truncated if the characters don't divide evenly.
+    */
+  def grouped(size: Int): Iterator[NonEmptyString] = {
+    if (size > 0) {
+      val itOfString = theString.grouped(size)
+      itOfString.map { list => new NonEmptyString(list) }
+    }
+    else
+      throw new IllegalArgumentException(s"Invalid size: $size")
+  }
+
+  /**
+    * Returns <code>true</code> to indicate this <code>NonEmptyString</code> has a definite size, since all <code>NonEmptyString</code>s are strict collections.
+    */
+  def hasDefiniteSize: Boolean = true
+
+  // override def hashCode: Int = toString.hashCode
+
+  /**
+    * Selects the first character of this <code>NonEmptyString</code>.
+    *
+    * @return the first character of this <code>NonEmptyString</code>.
+    */
+  def head: Char = theString.head
+
+
+  /**
+    * Finds index of first occurrence of some value in this <code>NonEmptyString</code>.
+    *
+    * @param c the character value to search for.
+    * @return the index of the first character of this <code>NonEmptyString</code> that is equal (as determined by <code>==</code>) to <code>c</code>,
+    *     or <code>-1</code>, if none exists.
+    */
+  def indexOf(c: Char): Int = theString.indexOf(c.toInt, 0)
+
+  /**
+    * Finds index of first occurrence of some value in this <code>NonEmptyString</code> after or at some start index.
+    *
+    * @param c the character value to search for.
+    * @param from the start index
+    * @return the index <code>&gt;=</code> <code>from</code> of the first element of this <code>NonEmptyString</code> that is equal (as determined by <code>==</code>) to <code>elem</code>,
+    *     or <code>-1</code>, if none exists.
+    */
+  def indexOf(c: Char, from: Int): Int = theString.indexOf(c.toInt, from)
+
+  /**
+    * Finds first index where this <code>NonEmptyString</code> contains a given <code>Seq[Char]</code> as a slice.
+    *
+    * @param that the <code>Seq[Char]</code> defining the slice to look for
+    * @return the first index at which the elements of this <code>NonEmptyString</code> starting at that index match the characters of
+    *     <code>Seq</code> <code>that</code>, or <code>-1</code> of no such subsequence exists. 
+    */
+  def indexOfSlice(that: Seq[Char]): Int = theString.indexOfSlice(that)
+
+  /**
+    * Finds first index after or at a start index where this <code>NonEmptyString</code> contains a given <code>Seq[Char]</code> as a slice.
+    *
+    * @param that the <code>Seq[Char]</code> defining the slice to look for
+    * @param from the start index
+    * @return the first index <code>&gt;=</code> <code>from</code> at which the characters of this <code>NonEmptyString</code> starting at that index match the characters of
+    *     <code>Seq[Char]</code> <code>that</code>, or <code>-1</code> of no such subsequence exists.
+    */
+  def indexOfSlice(that: Seq[Char], from: Int): Int = theString.indexOfSlice(that, from)
+
+  /**
+    * Finds first index where this <code>NonEmptyString</code> contains a given <code>Vector</code> as a slice.
+    *
+    * @param that the <code>Vector</code> defining the slice to look for
+    * @return the first index such that the characters of this <code>NonEmptyString</code> starting at this index match the characters of
+    *     <code>Vector</code> <code>that</code>, or <code>-1</code> of no such subsequence exists. 
+    */
+  def indexOfSlice(that: Vector[Char]): Int = theString.indexOfSlice(that)
+
+  /**
+    * Finds first index where this <code>NonEmptyString</code> contains a given <code>NonEmptyString</code> as a slice.
+    *
+    * @param that the <code>NonEmptyString</code> defining the slice to look for
+    * @return the first index such that the characters of this <code>NonEmptyString</code> starting at this index match the characters of
+    *     <code>NonEmptyString</code> <code>that</code>, or <code>-1</code> of no such subsequence exists. 
+    */
+  def indexOfSlice(that: NonEmptyString): Int = theString.indexOfSlice(that.theString)
+
+  /**
+    * Finds first index after or at a start index where this <code>NonEmptyString</code> contains a given <code>Vector</code> as a slice.
+    *
+    * @param that the <code>Vector</code> defining the slice to look for
+    * @param from the start index
+    * @return the first index <code>&gt;=</code> <code>from</code> such that the characters of this <code>NonEmptyString</code> starting at this index match the characters of
+    *     <code>Vector</code> <code>that</code>, or <code>-1</code> of no such subsequence exists. 
+    */
+  def indexOfSlice(that: Vector[Char], from: Int): Int = theString.indexOfSlice(that, from)
+
+  /**
+    * Finds first index after or at a start index where this <code>NonEmptyString</code> contains a given <code>NonEmptyString</code> as a slice.
+    *
+    * @param that the <code>NonEmptyString</code> defining the slice to look for
+    * @param from the start index
+    * @return the first index <code>&gt;=</code> <code>from</code> such that the characters of this <code>NonEmptyString</code> starting at this index match the characters of
+    *     <code>NonEmptyString</code> <code>that</code>, or <code>-1</code> of no such subsequence exists. 
+    */
+  def indexOfSlice(that: NonEmptyString, from: Int): Int = theString.indexOfSlice(that.theString, from)
+
+  /**
+    * Finds index of the first character satisfying some predicate.
+    *
+    * @param p the predicate used to test characters.
+    * @return the index of the first character of this <code>NonEmptyString</code> that satisfies the predicate <code>p</code>,
+    *     or <code>-1</code>, if none exists.
+    */
+  def indexWhere(p: Char => Boolean): Int = theString.indexWhere(p)
+
+  /**
+    * Finds index of the first character satisfying some predicate after or at some start index.
+    *
+    * @param p the predicate used to test characters.
+    * @param from the start index
+    * @return the index <code>&gt;=</code> <code>from</code> of the first character of this <code>NonEmptyString</code> that satisfies the predicate <code>p</code>,
+    *     or <code>-1</code>, if none exists.
+    */
+  def indexWhere(p: Char => Boolean, from: Int): Int = theString.indexWhere(p, from)
+
+  /**
+    * Produces the range of all indices of this <code>NonEmptyString</code>. 
+    *
+    * @return a <code>Range</code> value from <code>0</code> to one less than the length of this <code>NonEmptyString</code>. 
+    */
+  def indices: Range = theString.indices
+
+  /**
+    * Tests whether this <code>NonEmptyString</code> contains given index.
+    *
+    * @param idx the index to test
+    * @return true if this <code>NonEmptyString</code> contains an character at position <code>idx</code>, <code>false</code> otherwise.
+    */
+  def isDefinedAt(idx: Int): Boolean = theString.isDefinedAt(idx)
+
+  /**
+    * Returns <code>false</code> to indicate this <code>NonEmptyString</code>, like all <code>NonEmptyString</code>s, is non-empty.
+    *
+    * @return false
+    */
+  def isEmpty: Boolean = false
+
+  /**
+    * Returns <code>true</code> to indicate this <code>NonEmptyString</code>, like all <code>NonEmptyString</code>s, can be traversed repeatedly.
+    *
+    * @return true
+    */
+  def isTraversableAgain: Boolean = true
+
+  /**
+    * Creates and returns a new iterator over all characters contained in this <code>NonEmptyString</code>.
+    *
+    * @return the new iterator
+    */
+  def iterator: Iterator[Char] = theString.iterator
+
+  /**
+    * Selects the last character of this <code>NonEmptyString</code>.
+    *
+    * @return the last character of this <code>NonEmptyString</code>.
+    */
+  def last: Char = theString.last
+
+  /**
+    * Finds the index of the last occurrence of some value in this <code>NonEmptyString</code>.
+    *
+    * @param c the character value to search for.
+    * @return the index of the last character of this <code>NonEmptyString</code> that is equal (as determined by <code>==</code>) to <code>c</code>,
+    *     or <code>-1</code>, if none exists.
+    */
+  def lastIndexOf(c: Char): Int = theString.lastIndexOf(c.toInt)
+
+  /**
+    * Finds the index of the last occurrence of some value in this <code>NonEmptyString</code> before or at a given <code>end</code> index.
+    *
+    * @param c the character value to search for.
+    * @param end the end index. 
+    * @return the index <code>&gt;=</code> <code>end</code> of the last character of this <code>NonEmptyString</code> that is equal (as determined by <code>==</code>)
+    *     to <code>elem</code>, or <code>-1</code>, if none exists.
+    */
+  def lastIndexOf(c: Char, end: Int): Int = theString.lastIndexOf(c.toInt, end)
+
+  /**
+    * Finds the last index where this <code>NonEmptyString</code> contains a given <code>Seq</code> as a slice. 
+    *
+    * @param that the <code>Seq</code> defining the slice to look for
+    * @return the last index at which the elements of this <code>NonEmptyString</code> starting at that index match the characters of
+    *    <code>Seq</code> <code>that</code>, or <code>-1</code> of no such subsequence exists. 
+    */
+  def lastIndexOfSlice(that: Seq[Char]): Int = theString.lastIndexOfSlice(that)
+
+  /**
+    * Finds the last index before or at a given end index where this <code>NonEmptyString</code> contains a given <code>Seq</code> as a slice. 
+    *
+    * @param that the <code>Seq</code> defining the slice to look for
+    * @param end the end index
+    * @return the last index <code>&gt;=</code> <code>end</code> at which the elements of this <code>NonEmptyString</code> starting at that index match the characters of
+    *    <code>Seq</code> <code>that</code>, or <code>-1</code> of no such subsequence exists. 
+    */
+  def lastIndexOfSlice(that: Seq[Char], end: Int): Int = theString.lastIndexOfSlice(that, end)
+
+  /**
+    * Finds the last index where this <code>NonEmptyString</code> contains a given <code>Vector</code> as a slice. 
+    *
+    * @param that the <code>Vector</code> defining the slice to look for
+    * @return the last index at which the elements of this <code>NonEmptyString</code> starting at that index match the characters of
+    *    <code>Vector</code> <code>that</code>, or <code>-1</code> of no such subsequence exists. 
+    */
+  def lastIndexOfSlice(that: Vector[Char]): Int = theString.lastIndexOfSlice(that)
+
+  /**
+    * Finds the last index where this <code>NonEmptyString</code> contains a given <code>NonEmptyString</code> as a slice. 
+    *
+    * @param that the <code>NonEmptyString</code> defining the slice to look for
+    * @return the last index at which the elements of this <code>NonEmptyString</code> starting at that index match the characters of
+    *    <code>NonEmptyString</code> <code>that</code>, or <code>-1</code> of no such subsequence exists. 
+    */
+  def lastIndexOfSlice(that: NonEmptyString): Int = theString.lastIndexOfSlice(that.theString)
+
+  /**
+    * Finds the last index before or at a given end index where this <code>NonEmptyString</code> contains a given <code>Vector</code> as a slice. 
+    *
+    * @param that the <code>Vector</code> defining the slice to look for
+    * @param end the end index
+    * @return the last index <code>&gt;=</code> <code>end</code> at which the elements of this <code>NonEmptyString</code> starting at that index match the characters of
+    *    <code>Vector</code> <code>that</code>, or <code>-1</code> of no such subsequence exists. 
+    */
+  def lastIndexOfSlice(that: Vector[Char], end: Int): Int = theString.lastIndexOfSlice(that, end)
+
+  /**
+    * Finds the last index before or at a given end index where this <code>NonEmptyString</code> contains a given <code>NonEmptyString</code> as a slice. 
+    *
+    * @param that the <code>NonEmptyString</code> defining the slice to look for
+    * @param end the end index
+    * @return the last index <code>&gt;=</code> <code>end</code> at which the characters of this <code>NonEmptyString</code> starting at that index match the characters of
+    *    <code>NonEmptyString</code> <code>that</code>, or <code>-1</code> of no such subsequence exists. 
+    */
+  def lastIndexOfSlice(that: NonEmptyString, end: Int): Int = theString.lastIndexOfSlice(that.theString, end)
+
+  /**
+    * Finds index of last character satisfying some predicate.
+    *
+    * @param p the predicate used to test characters.
+    * @return the index of the last character of this <code>NonEmptyString</code> that satisfies the predicate <code>p</code>, or <code>-1</code>, if none exists.
+    */
+  def lastIndexWhere(p: Char => Boolean): Int = theString.lastIndexWhere(p)
+
+  /**
+    * Finds index of last character satisfying some predicate before or at given end index.
+    *
+    * @param p the predicate used to test characters.
+    * @param end the end index
+    * @return the index <code>&gt;=</code> <code>end</code> of the last character of this <code>NonEmptyString</code> that satisfies the predicate <code>p</code>,
+    *     or <code>-1</code>, if none exists. 
+    */
+  def lastIndexWhere(p: Char => Boolean, end: Int): Int = theString.lastIndexWhere(p, end)
+
+  /**
+    * The length of this <code>NonEmptyString</code>.
+    *
+    * <p>
+    * Note: <code>length</code> and <code>size</code> yield the same result, which will be <code>&gt;</code>= 1. 
+    * </p>
+    *
+    * @return the number of characters in this <code>NonEmptyString</code>.
+    */
+  def length: Int = theString.length
+
+  /**
+    * Compares the length of this <code>NonEmptyString</code> to a test value. 
+    *
+    * @param len the test value that gets compared with the length.
+    * @return a value <code>x</code> where
+    *
+    * <pre>
+    * x &lt; 0 if this.length &lt; len
+    * x == 0 if this.length == len
+    * x &gt; 0 if this.length &gt; len
+    * </pre>
+    */
+  def lengthCompare(len: Int): Int = theString.lengthCompare(len)
+
+  /**
+    * Builds a new <code>NonEmptyString</code> by applying a function to all characters of this <code>NonEmptyString</code>.
+    *
+    * @tparam U the character type of the returned <code>NonEmptyString</code>.
+    * @param f the function to apply to each character.
+    * @return a new <code>NonEmptyString</code> resulting from applying the given function <code>f</code> to each character of this <code>NonEmptyString</code> and collecting the results.
+    */
+  def map[U](f: Char => U): NonEmptyString = {
+    //NonEmptyString("test")
+    new NonEmptyString(
+      theString.map { c =>
+        f(c).toString
+      }.mkString
+    )
+  }
+
+  /**
+    * Finds the largest character.
+    *
+    * @return the largest element of this <code>NonEmptyString</code>. 
+    */
+  def max(implicit cmp: Ordering[Char]): Char = theString.max(cmp)
+
+  /**
+    * Finds the largest result after applying the given function to every character.
+    *
+    * @return the largest result of applying the given function to every character of this <code>NonEmptyString</code>.
+    */
+  def maxBy[U](f: Char => U)(implicit cmp: Ordering[U]): Char = theString.maxBy(f)(cmp)
+
+  /**
+    * Finds the smallest character.
+    *
+    * @return the smallest character of this <code>NonEmptyString</code>.
+    */
+  def min(implicit cmp: Ordering[Char]): Char = theString.min(cmp)
+
+  /**
+    * Finds the smallest result after applying the given function to every character.
+    *
+    * @return the smallest result of applying the given function to every character of this <code>NonEmptyString</code>.
+    */
+  def minBy[U](f: Char => U)(implicit cmp: Ordering[U]): Char = theString.minBy(f)(cmp)
+
+  /**
+    * Displays all characters of this <code>NonEmptyString</code> in a string.
+    *
+    * @return a string representation of this <code>NonEmptyString</code>. In the resulting string, the result of invoking <code>toString</code> on all characters of this
+    *     <code>NonEmptyString</code> follow each other without any separator string. 
+    */
+  def mkString: String = theString.mkString
+
+  /**
+    * Displays all elements of this <code>NonEmptyString</code> in a string using a separator string. 
+    *
+    * @param sep the separator string
+    * @return a string representation of this <code>NonEmptyString</code>. In the resulting string, the result of invoking <code>toString</code> on all elements of this
+    *     <code>NonEmptyString</code> are separated by the string <code>sep</code>. 
+    */
+  def mkString(sep: String): String = theString.mkString(sep)
+
+  /**
+    * Displays all characters of this <code>NonEmptyString</code> in a string using start, end, and separator strings.
+    *
+    * @param start the starting string.
+    * @param sep the separator string.
+    * @param end the ending string.
+    * @return a string representation of this <code>NonEmptyString</code>. The resulting string begins with the string <code>start</code> and ends with the string
+    *     <code>end</code>. Inside, In the resulting string, the result of invoking <code>toString</code> on all characters of this <code>NonEmptyString</code> are
+    *     separated by the string <code>sep</code>. 
+    */
+  def mkString(start: String, sep: String, end: String): String = theString.mkString(start, sep, end)
+
+  /**
+    * Returns <code>true</code> to indicate this <code>NonEmptyString</code>, like all <code>NonEmptyString</code>s, is non-empty.
+    *
+    * @return true
+    */
+  def nonEmpty: Boolean = true
+
+  /**
+    * A copy of this <code>NonEmptyString</code> with an element value appended until a given target length is reached.
+    *
+    * @param len the target length 
+    * @param c the padding character
+    * @return a new <code>NonEmptyString</code> consisting of all characters of this <code>NonEmptyString</code> followed by the minimal number of occurrences
+    *     of <code>elem</code> so that the resulting <code>NonEmptyString</code> has a length of at least <code>len</code>. 
+    */
+  def padTo(len: Int, c: Char): NonEmptyString =
+    new NonEmptyString(theString.padTo(len, c))
+
+  /**
+    * Produces a new <code>NonEmptyString</code> where a slice of characters in this <code>NonEmptyString</code> is replaced by another <code>NonEmptyString</code>
+    *
+    * @param from the index of the first replaced character
+    * @param that the <code>NonEmptyString</code> whose characters should replace a slice in this <code>NonEmptyString</code>
+    * @param replaced the number of characters to drop in the original <code>NonEmptyString</code>
+    */
+  def patch(from: Int, that: NonEmptyString, replaced: Int): NonEmptyString =
+    new NonEmptyString(theString.patch(from, that.theString, replaced))
+
+  /**
+    * Iterates over distinct permutations. 
+    *
+    * <p>
+    * Here's an example:
+    * </p>
+    *
+    * <pre class="stHighlight">
+    * NonEmptyString("abb").permutations.toList == list(NonEmptyString("abb"), NonEmptyString("bab"), NonEmptyString("bba"))
+    * </pre>
+    *
+    * @return an iterator that traverses the distinct permutations of this <code>NonEmptyString</code>.
+    */
+  def permutations: Iterator[NonEmptyString] = {
+    val it = theString.iterator.toSeq.permutations
+    it map { list => new NonEmptyString(list.mkString) }
+  }
+
+  /**
+    * Returns the length of the longest prefix whose characters all satisfy some predicate.
+    *
+    * @param p the predicate used to test characters.
+    * @return the length of the longest prefix of this <code>NonEmptyString</code> such that every characters
+    *     of the segment satisfies the predicate <code>p</code>. 
+    */
+  def prefixLength(p: Char => Boolean): Int = theString.segmentLength(p, 0)
+
+  /**
+    * The result of multiplying all the characters of this <code>NonEmptyString</code>.
+    *
+    * <p>
+    * This method can be invoked for any <code>NonEmptyString</code> for which an implicit <code>Numeric[T]</code> exists.
+    * </p>
+    *
+    * @return the product of all elements
+    */
+  def product(implicit num: Numeric[Char]): Char = theString.product(num)
+
+  /**
+    * Reduces the elements of this <code>NonEmptyString</code> using the specified associative binary operator.
+    *
+    * <p>
+    * The order in which operations are performed on characters is unspecified and may be nondeterministic.
+    * </p>
+    *
+    * @param op a binary operator that must be associative.
+    * @return the result of applying reduce operator <code>op</code> between all the characters of this <code>NonEmptyString</code>.
+    */
+  def reduce(op: (Char, Char) => Char): Char = theString.reduce(op)
+
+  /**
+    * Applies a binary operator to all characters of this <code>NonEmptyString</code>, going left to right.
+    *
+    * @param op the binary operator.
+    * @return the result of inserting <code>op</code> between consecutive characters of this <code>NonEmptyString</code>, going left to right:
+    *
+    * <pre>
+    * op(...op(op(x_1, x_2), x_3), ..., x_n)
+    * </pre>
+    *
+    * <p>
+    * where x<sub>1</sub>, ..., x<sub>n</sub> are the characters of this <code>NonEmptyString</code>.
+    * </p>
+    */
+  def reduceLeft(op: (Char, Char) => Char): Char = theString.reduceLeft(op)
+
+  /**
+    * Applies a binary operator to all characters of this <code>NonEmptyString</code>, going left to right, returning the result in a <code>Some</code>.
+    *
+    * @param op the binary operator.
+    * @return a <code>Some</code> containing the result of <code>reduceLeft(op)</code>
+    * </p>
+    */
+  def reduceLeftOption(op: (Char, Char) => Char): Option[Char] = theString.reduceLeftOption(op)
+
+  def reduceOption(op: (Char, Char) => Char): Option[Char] = theString.reduceOption(op)
+
+  /**
+    * Applies a binary operator to all characters of this <code>NonEmptyString</code>, going right to left.
+    *
+    * @param op the binary operator
+    * @return the result of inserting <code>op</code> between consecutive characters of this <code>NonEmptyString</code>, going right to left:
+    *
+    * <pre>
+    * op(x_1, op(x_2, ... op(x_{n-1}, x_n)...))
+    * </pre>
+    *
+    * <p>
+    * where x<sub>1</sub>, ..., x<sub>n</sub> are the elements of this <code>NonEmptyString</code>. 
+    * </p>
+    */
+  def reduceRight(op: (Char, Char) => Char): Char = theString.reduceRight(op)
+
+  /**
+    * Applies a binary operator to all elements of this <code>NonEmptyString</code>, going right to left, returning the result in a <code>Some</code>.
+    *
+    * @param op the binary operator
+    * @return a <code>Some</code> containing the result of <code>reduceRight(op)</code>
+    */
+  def reduceRightOption(op: (Char, Char) => Char): Option[Char] = theString.reduceRightOption(op)
+
+  /**
+    * Returns new <code>NonEmptyString</code> with characters in reverse order.
+    *
+    * @return a new <code>NonEmptyString</code> with all characters of this <code>NonEmptyString</code> in reversed order.
+    */
+  def reverse: NonEmptyString =
+    new NonEmptyString(theString.reverse)
+
+  /**
+    * An iterator yielding characters in reverse order.
+    *
+    * <p>
+    * Note: <code>nonEmptyString.reverseIterator</code> is the same as <code>nonEmptyString.reverse.iterator</code>, but might be more efficient. 
+    * </p>
+    *
+    * @return an iterator yielding the characters of this <code>NonEmptyString</code> in reversed order
+    */
+  def reverseIterator: Iterator[Char] = theString.reverseIterator
+
+  /**
+    * Builds a new <code>Iterable</code> by applying a function to all characters of this <code>NonEmptyString</code> and collecting the results in reverse order.
+    *
+    * <p>
+    * Note: <code>nonEmptyString.reverseMap(f)</code> is the same as <code>nonEmptyString.reverse.map(f)</code>, but might be more efficient. 
+    * </p>
+    *
+    * @tparam U the element type of the returned <code>Iterable</code>.
+    * @param f the function to apply to each character.
+    * @return a new <code>Iterable</code> resulting from applying the given function <code>f</code> to each character of this <code>NonEmptyString</code>
+    *     and collecting the results in reverse order. 
+    */
+  def reverseMap[U](f: Char => U): Iterable[U] = theString.reverseIterator.map(f).toVector
+
+  /**
+    * Checks if the given <code>Iterable</code> contains the same characters in the same order as this <code>NonEmptyString</code>.
+    *
+    * @param that the <code>Iterable</code> with which to compare
+    * @return <code>true</code>, if both this <code>NonEmptyString</code> and the given <code>Iterable</code> contain the same characters
+    *     in the same order, <code>false</code> otherwise. 
+    */
+  def sameElements(that: Iterable[Char]): Boolean = theString.sameElements(that)
+
+  /**
+    * Checks if the given <code>Vector</code> contains the same characters in the same order as this <code>NonEmptyString</code>.
+    *
+    * @param that the <code>Vector</code> with which to compare
+    * @return <code>true</code>, if both this and the given <code>Vector</code> contain the same characters
+    *     in the same order, <code>false</code> otherwise. 
+    */
+  def sameElements(that: Vector[Char]): Boolean = theString.sameElements(that)
+
+  /**
+    * Checks if the given <code>NonEmptyString</code> contains the same characters in the same order as this <code>NonEmptyString</code>.
+    *
+    * @param that the <code>NonEmptyString</code> with which to compare
+    * @return <code>true</code>, if both this and the given <code>NonEmptyString</code> contain the same characters
+    *     in the same order, <code>false</code> otherwise. 
+    */
+  def sameElements(that: NonEmptyString): Boolean = theString.sameElements(that.theString)
+
+  /**
+    * Computes a prefix scan of the characters of this <code>NonEmptyString</code>.
+    *
+    * <p>
+    * Note: The neutral character z may be applied more than once.
+    * </p>
+    *
+    * <p>
+    * Here are some examples:
+    * </p>
+    *
+    * <pre class="stHighlight">
+    * NonEmptyString("123").scan(0)(_ + _) == NonEmptyString(0, 1, 3, 6)
+    * NonEmptyString("123").scan("z")(_ + _.toString) == NonEmptyString("z", "z1", "z12", "z123")
+    * </pre>
+    *
+    * @param z a neutral element for the scan operation; may be added to the result an arbitrary number of
+    *     times, and must not change the result (<em>e.g.</em>, <code>Nil</code> for list concatenation,
+    *     0 for addition, or 1 for multiplication.)
+    * @param op a binary operator that must be associative
+    * @return a new <code>NonEmptyString</code> containing the prefix scan of the elements in this <code>NonEmptyString</code> 
+    */
+  def scan(z: Char)(op: (Char, Char) => Char): NonEmptyString = new NonEmptyString(theString.scan(z)(op).mkString)
+
+  /**
+    * Produces a <code>NonEmptyString</code> containing cumulative results of applying the operator going left to right.
+    *
+    * <p>
+    * Here are some examples:
+    * </p>
+    *
+    * <pre class="stHighlight">
+    * NonEmptyString("123").scanLeft(0)(_ + _.toString.toInt) == Vector(0, 1, 3, 6)
+    * NonEmptyString("123").scanLeft("z")(_ + _) == Vector("z", "z1", "z12", "z123")
+    * </pre>
+    *
+    * @tparam B the result type of the binary operator and type of the resulting <code>NonEmptyString</code>
+    * @param z the start value.
+    * @param op the binary operator.
+    * @return a new <code>NonEmptyString</code> containing the intermediate results of inserting <code>op</code> between consecutive characters of this <code>NonEmptyString</code>,
+    *     going left to right, with the start value, <code>z</code>, on the left.
+    */
+  def scanLeft[B](z: B)(op: (B, Char) => B): Iterable[B] = theString.scanLeft(z)(op)
+
+  /**
+    * Produces a <code>NonEmptyString</code> containing cumulative results of applying the operator going right to left.
+    *
+    * <p>
+    * Here are some examples:
+    * </p>
+    *
+    * <pre class="stHighlight">
+    * NonEmptyString("123").scanRight(0)(_.toString.toInt + _) == NonEmptyString(6, 5, 3, 0)
+    * NonEmptyString("123").scanRight("z")(_ + _) == NonEmptyString("123z", "23z", "3z", "z")
+    * </pre>
+    *
+    * @tparam B the result of the binary operator and type of the resulting <code>NonEmptyString</code>
+    * @param z the start value
+    * @param op the binary operator
+    * @return a new <code>NonEmptyString</code> containing the intermediate results of inserting <code>op</code> between consecutive characters of this <code>NonEmptyString</code>,
+    *     going right to left, with the start value, <code>z</code>, on the right.
+    */
+  def scanRight[B](z: B)(op: (Char, B) => B): Iterable[B] = theString.scanRight(z)(op)
+
+  /**
+    * Computes length of longest segment whose characters all satisfy some predicate.
+    *
+    * @param p the predicate used to test elements.
+    * @param from the index where the search starts.
+    * @return the length of the longest segment of this <code>NonEmptyString</code> starting from index <code>from</code> such that every character of the
+    *     segment satisfies the predicate <code>p</code>. 
+    */
+  def segmentLength(p: Char => Boolean, from: Int): Int = theString.segmentLength(p, from)
+
+  /**
+    * Groups characters in fixed size blocks by passing a &ldquo;sliding window&rdquo; over them (as opposed to partitioning them, as is done in grouped.)
+    *
+    * @param size the number of characters per group
+    * @return an iterator producing <code>NonEmptyString</code>s of size <code>size</code>, except the last and the only element will be truncated
+    *     if there are fewer characters than <code>size</code>.
+    */
+  def sliding(size: Int): Iterator[NonEmptyString] = theString.iterator.sliding(size).map(s => new NonEmptyString(s.mkString))
+
+  /**
+    * Groups characters in fixed size blocks by passing a &ldquo;sliding window&rdquo; over them (as opposed to partitioning them, as is done in grouped.),
+    * moving the sliding window by a given <code>step</code> each time.
+    *
+    * @param size the number of characters per group
+    * @param step the distance between the first characters of successive groups
+    * @return an iterator producing <code>NonEmptyString</code>s of size <code>size</code>, except the last and the only character will be truncated
+    *     if there are fewer characters than <code>size</code>.
+    */
+  def sliding(size: Int, step: Int): Iterator[NonEmptyString] = theString.iterator.sliding(size, step).map(s => new NonEmptyString(s.mkString))
+
+  /**
+    * The size of this <code>NonEmptyString</code>.
+    *
+    * <p>
+    * Note: <code>length</code> and <code>size</code> yield the same result, which will be <code>&gt;</code>= 1. 
+    * </p>
+    *
+    * @return the number of characters in this <code>NonEmptyString</code>.
+    */
+  def size: Int = theString.size
+
+  /**
+    * Sorts this <code>NonEmptyString</code> according to the <code>Ordering</code> of the result of applying the given function to every character.
+    *
+    * @tparam U the target type of the transformation <code>f</code>, and the type where the <code>Ordering</code> <code>ord</code> is defined.
+    * @param f the transformation function mapping elements to some other domain <code>U</code>.
+    * @param ord the ordering assumed on domain <code>U</code>.
+    * @return a <code>NonEmptyString</code> consisting of the elements of this <code>NonEmptyString</code> sorted according to the <code>Ordering</code> where
+    *    <code>x &lt; y if ord.lt(f(x), f(y))</code>. 
+    */
+  def sortBy[U](f: Char => U)(implicit ord: Ordering[U]): NonEmptyString = new NonEmptyString(theString.iterator.toSeq.sortBy(f).mkString)
+
+  /**
+    * Sorts this <code>NonEmptyString</code> according to a comparison function.
+    *
+    * <p>
+    * The sort is stable. That is, characters that are equal (as determined by <code>lt</code>) appear in the same order in the
+    * sorted <code>NonEmptyString</code> as in the original. 
+    * </p>
+    *
+    * @param lt the comparison function that tests whether its first argument precedes its second argument in the desired ordering.
+    * @return a <code>NonEmptyString</code> consisting of the elements of this <code>NonEmptyString</code> sorted according to the comparison function <code>lt</code>.
+    */
+  def sortWith(lt: (Char, Char) => Boolean): NonEmptyString = new NonEmptyString(theString.iterator.toSeq.sortWith(lt).mkString)
+
+  /**
+    * Sorts this <code>NonEmptyString</code> according to an <code>Ordering</code>.
+    *
+    * <p>
+    * The sort is stable. That is, elements that are equal (as determined by <code>lt</code>) appear in the same order in the
+    * sorted <code>NonEmptyString</code> as in the original. 
+    * </p>
+    *
+    * @param ord the <code>Ordering</code> to be used to compare elements.
+    * @return a <code>NonEmptyString</code> consisting of the characters of this <code>NonEmptyString</code> sorted according to the ordering defined by <code>ord</code>.
+    */
+  def sorted(implicit ord: Ordering[Char]): NonEmptyString = new NonEmptyString(theString.iterator.toSeq.sorted(ord).mkString)
+
+  /**
+    * Indicates whether this <code>NonEmptyString</code> starts with the given <code>Seq</code>. 
+    *
+    * @param that the <code>Seq</code> slice to look for in this <code>NonEmptyString</code>
+    * @return <code>true</code> if this <code>NonEmptyString</code> has <code>that</code> as a prefix, <code>false</code> otherwise.
+    */
+  def startsWith(that: Seq[Char]): Boolean = theString.startsWith(that)
+
+  /**
+    * Indicates whether this <code>NonEmptyString</code> starts with the given <code>Seq</code> at the given index. 
+    *
+    * @param that the <code>Seq</code> slice to look for in this <code>NonEmptyString</code>
+    * @param offset the index at which this <code>NonEmptyString</code> is searched.
+    * @return <code>true</code> if this <code>NonEmptyString</code> has <code>that</code> as a slice at the index <code>offset</code>, <code>false</code> otherwise.
+    */
+  def startsWith(that: Seq[Char], offset: Int): Boolean = theString.startsWith(that, offset)
+
+  /**
+    * Indicates whether this <code>NonEmptyString</code> starts with the given <code>Vector</code>. 
+    *
+    * @param that the <code>Vector</code> to test
+    * @return <code>true</code> if this collection has <code>that</code> as a prefix, <code>false</code> otherwise.
+    */
+  def startsWith(that: Vector[Char]): Boolean = theString.startsWith(that)
+
+  /**
+    * Indicates whether this <code>NonEmptyString</code> starts with the given <code>NonEmptyString</code>. 
+    *
+    * @param that the <code>NonEmptyString</code> to test
+    * @return <code>true</code> if this collection has <code>that</code> as a prefix, <code>false</code> otherwise.
+    */
+  def startsWith(that: NonEmptyString): Boolean = theString.startsWith(that.theString)
+
+  /**
+    * Indicates whether this <code>NonEmptyString</code> starts with the given <code>Vector</code> at the given index. 
+    *
+    * @param that the <code>Vector</code> slice to look for in this <code>NonEmptyString</code>
+    * @param offset the index at which this <code>NonEmptyString</code> is searched.
+    * @return <code>true</code> if this <code>NonEmptyString</code> has <code>that</code> as a slice at the index <code>offset</code>, <code>false</code> otherwise.
+    */
+  def startsWith(that: Vector[Char], offset: Int): Boolean = theString.startsWith(that, offset)
+
+  /**
+    * Indicates whether this <code>NonEmptyString</code> starts with the given <code>NonEmptyString</code> at the given index. 
+    *
+    * @param that the <code>NonEmptyString</code> slice to look for in this <code>NonEmptyString</code>
+    * @param offset the index at which this <code>NonEmptyString</code> is searched.
+    * @return <code>true</code> if this <code>NonEmptyString</code> has <code>that</code> as a slice at the index <code>offset</code>, <code>false</code> otherwise.
+    */
+  def startsWith(that: NonEmptyString, offset: Int): Boolean = theString.startsWith(that.theString, offset)
+
+  /**
+    * Returns <code>"NonEmptyString"</code>, the prefix of this object's <code>toString</code> representation.
+    *
+    * @return the string <code>"NonEmptyString"</code>
+    */
+  def stringPrefix: String = "NonEmptyString"
+
+  /**
+    * The result of summing all the characters of this <code>NonEmptyString</code>.
+    *
+    * <p>
+    * This method can be invoked for any <code>NonEmptyString</code> for which an implicit <code>Numeric[Char]</code> exists.
+    * </p>
+    *
+    * @return the sum of all elements
+    */
+  def sum(implicit num: Numeric[Long]): Long = theString.iterator.map(_.toLong).sum(num)
+
+
+  /**
+    * Converts this <code>NonEmptyString</code> into a collection of type <code>Col</code> by copying all elements.
+    *
+    * @tparam C1 the collection type to build.
+    * @return a new collection containing all elements of this <code>NonEmptyString</code>. 
+    */
+  def to[C1](factory: Factory[Char, C1]): C1 = factory.fromSpecific(iterator)
+
+
+  /**
+    * Converts this <code>NonEmptyString</code> to an array.
+    *
+    * @return an array containing all characters of this <code>NonEmptyString</code>. A <code>ClassTag</code> must be available for the element type of this <code>NonEmptyString</code>.
+    */
+  def toArray(implicit classTag: ClassTag[Char]): Array[Char] = theString.toArray
+
+  /**
+    * Converts this <code>NonEmptyString</code> to a <code>Vector</code>.
+    *
+    * @return a <code>Vector</code> containing all characters of this <code>NonEmptyString</code>.
+    */
+  def toVector: Vector[Char] = theString.toVector
+
+  /**
+    * Converts this <code>NonEmptyString</code> to a mutable buffer.
+    *
+    * @return a buffer containing all characters of this <code>NonEmptyString</code>.
+    */
+  def toBuffer: Buffer[Char] = theString.toBuffer
+
+  /**
+    * Converts this <code>NonEmptyString</code> to an immutable <code>IndexedSeq</code>.
+    *
+    * @return an immutable <code>IndexedSeq</code> containing all characters of this <code>NonEmptyString</code>.
+    */
+  def toIndexedSeq: collection.immutable.IndexedSeq[Char] = theString.toVector
+
+  /**
+    * Converts this <code>NonEmptyString</code> to an iterable collection.
+    *
+    * @return an <code>Iterable</code> containing all characters of this <code>NonEmptyString</code>.
+    */
+  def toIterable: Iterable[Char] = theString.toIterable
+
+  /**
+    * Returns an <code>Iterator</code> over the elements in this <code>NonEmptyString</code>.
+    *
+    * @return an <code>Iterator</code> containing all characters of this <code>NonEmptyString</code>.
+    */
+  def toIterator: Iterator[Char] = theString.iterator
+
+  /**
+    * Converts this <code>NonEmptyString</code> to a map.
+    *
+    * <p>
+    * This method is unavailable unless the elements are members of <code>Tuple2</code>, each <code>((K, V))</code> becoming a key-value pair
+    * in the map. Duplicate keys will be overwritten by later keys.
+    * </p>
+    *
+    * @return a map of type <code>immutable.Map[Int, Char]</code> containing all index/character pairs of type <code>(Int, Char)</code> of this <code>NonEmptyString</code>.
+    */
+  def toMap: Map[Int, Char] = Map.empty[Int, Char] ++ theString.zipWithIndex.map(e => e._2 -> e._1)
+
+  /**
+    * Converts this <code>NonEmptyString</code> to an immutable <code>IndexedSeq</code>.
+    *
+    * @return an immutable <code>IndexedSeq</code> containing all characters of this <code>NonEmptyString</code>.
+    */
+  def toSeq: collection.immutable.Seq[Char] = theString
+
+  /**
+    * Converts this <code>NonEmptyString</code> to a set.
+    *
+    * @return a set containing all characters of this <code>NonEmptyString</code>.
+    */
+  def toSet: Set[Char] = theString.toSet
+
+
+  /**
+    * Returns a string representation of this <code>NonEmptyString</code>.
+    *
+    * @return the string <code>"NonEmptyString"</code> followed by the result of invoking <code>toString</code> on
+    *   this <code>NonEmptyString</code>'s elements, surrounded by parentheses.
+    */
+  override def toString: String = stringPrefix + "(" + theString + ")"
+
+  /**
+    * Produces a new <code>NonEmptyString</code> that contains all characters of this <code>NonEmptyString</code> and also all characters of a given <code>Vector</code>.
+    *
+    * <p>
+    * <code>nonEmptyStringX</code> <code>union</code> <code>everyY</code> is equivalent to <code>nonEmptyStringX</code> <code>++</code> <code>everyY</code>.
+    * </p>
+    *
+    * <p>
+    * Another way to express this is that <code>nonEmptyStringX</code> <code>union</code> <code>everyY</code> computes the order-presevring multi-set union
+    * of <code>nonEmptyStringX</code> and <code>everyY</code>. This <code>union</code> method is hence a counter-part of <code>diff</code> and <code>intersect</code> that
+    * also work on multi-sets.
+    * </p>
+    *
+    * @param that the <code>Vector</code> to add.
+    * @return a new <code>NonEmptyString</code> that contains all characters of this <code>NonEmptyString</code> followed by all characters of <code>that</code> <code>Vector</code>.
+    */
+  def union(that: Vector[Char]): NonEmptyString = new NonEmptyString(theString + that.mkString)
+
+  /**
+    * Produces a new <code>NonEmptyString</code> that contains all characters of this <code>NonEmptyString</code> and also all characters of a given <code>NonEmptyString</code>.
+    *
+    * <p>
+    * <code>nonEmptyStringX</code> <code>union</code> <code>nonEmptyStringY</code> is equivalent to <code>nonEmptyStringX</code> <code>++</code> <code>nonEmptyStringY</code>.
+    * </p>
+    *
+    * <p>
+    * Another way to express this is that <code>nonEmptyStringX</code> <code>union</code> <code>nonEmptyStringY</code> computes the order-presevring multi-set union
+    * of <code>nonEmptyStringX</code> and <code>nonEmptyStringY</code>. This <code>union</code> method is hence a counter-part of <code>diff</code> and <code>intersect</code> that
+    * also work on multi-sets.
+    * </p>
+    *
+    * @param that the <code>NonEmptyString</code> to add.
+    * @return a new <code>NonEmptyString</code> that contains all elements of this <code>NonEmptyString</code> followed by all characters of <code>that</code>.
+    */
+  def union(that: NonEmptyString): NonEmptyString = new NonEmptyString(theString + that.theString)
+
+  /**
+    * Produces a new <code>NonEmptyString</code> that contains all characters of this <code>NonEmptyString</code> and also all characters of a given <code>Seq</code>.
+    *
+    * <p>
+    * <code>nonEmptyStringX</code> <code>union</code> <code>ys</code> is equivalent to <code>nonEmptyStringX</code> <code>++</code> <code>ys</code>.
+    * </p>
+    *
+    * <p>
+    * Another way to express this is that <code>nonEmptyStringX</code> <code>union</code> <code>ys</code> computes the order-presevring multi-set union
+    * of <code>nonEmptyStringX</code> and <code>ys</code>. This <code>union</code> method is hence a counter-part of <code>diff</code> and <code>intersect</code> that
+    * also work on multi-sets.
+    * </p>
+    *
+    * @param that the <code>Seq</code> to add.
+    * @return a new <code>NonEmptyString</code> that contains all elements of this <code>NonEmptyString</code> followed by all elements of <code>that</code> <code>Seq</code>.
+    */
+  def union(that: Seq[Char]): NonEmptyString = new NonEmptyString(theString + that.mkString)
+
+  /**
+    * Converts this <code>NonEmptyString</code> of pairs into two <code>NonEmptyString</code>s of the first and second half of each pair. 
+    *
+    * @tparam L the type of the first half of the character pairs
+    * @tparam R the type of the second half of the character pairs
+    * @param asPair an implicit conversion that asserts that the character type of this <code>NonEmptyString</code> is a pair.
+    * @return a pair of <code>NonEmptyString</code>s, containing the first and second half, respectively, of each character pair of this <code>NonEmptyString</code>.
+    */
+  def unzip[L, R](implicit asPair: Char => (L, R)): (Iterable[L], Iterable[R]) = {
+    val unzipped = theString.unzip
+    (unzipped._1, unzipped._2)
+  }
+
+  /**
+    * Converts this <code>NonEmptyString</code> of triples into three <code>NonEmptyString</code>s of the first, second, and and third character of each triple.
+    *
+    * @tparam L the type of the first member of the character triples
+    * @tparam R the type of the second member of the character triples
+    * @tparam R the type of the third member of the character triples
+    * @param asTriple an implicit conversion that character that the character type of this <code>NonEmptyString</code> is a triple.
+    * @return a triple of <code>NonEmptyString</code>s, containing the first, second, and third member, respectively, of each character triple of this <code>NonEmptyString</code>.
+    */
+  def unzip3[L, M, R](implicit asTriple: Char => (L, M, R)): (Iterable[L], Iterable[M], Iterable[R]) = {
+    val unzipped = theString.unzip3
+    (unzipped._1, unzipped._2, unzipped._3)
+  }
+
+  /**
+    * A copy of this <code>NonEmptyString</code> with one single replaced character.
+    *
+    * @param idx the position of the replacement
+    * @param c the replacing character
+    * @throws IndexOutOfBoundsException if the passed index is greater than or equal to the length of this <code>NonEmptyString</code>
+    * @return a copy of this <code>NonEmptyString</code> with the character at position <code>idx</code> replaced by <code>c</code>.
+    */
+  def updated(idx: Int, c: Char): NonEmptyString =
+    try new NonEmptyString(theString.updated(idx, c))
+    catch { case _: UnsupportedOperationException => throw new IndexOutOfBoundsException(idx.toString) } // This is needed for 2.10 support. Can drop after.
+  // Because 2.11 throws IndexOutOfBoundsException.
+
+  /**
+    * Returns a <code>NonEmptyString</code> formed from this <code>NonEmptyString</code> and an iterable collection by combining corresponding
+    * elements in pairs. If one of the two collections is shorter than the other, placeholder elements will be used to extend the
+    * shorter collection to the length of the longer.
+    *
+    * @tparam O the element type of the <code>other</code>
+    * @param other the <code>Iterable</code> providing the second half of each result pair
+    * @param thisElem the element to be used to fill up the result if this <code>NonEmptyString</code> is shorter than <code>that</code> <code>Iterable</code>.
+    * @param otherElem the element to be used to fill up the result if <code>that</code> <code>Iterable</code> is shorter than this <code>NonEmptyString</code>.
+    * @return a new <code>NonEmptyString</code> containing pairs consisting of corresponding characters of this <code>NonEmptyString</code> and <code>that</code>. The
+    *     length of the returned collection is the maximum of the lengths of this <code>NonEmptyString</code> and <code>that</code>. If this <code>NonEmptyString</code>
+    *     is shorter than <code>that</code>, <code>thisElem</code> values are used to pad the result. If <code>that</code> is shorter than this
+    *     <code>NonEmptyString</code>, <code>thatElem</code> values are used to pad the result. 
+    */
+  def zipAll[O](other: collection.Iterable[O], thisElem: Char, otherElem: O): Iterable[(Char, O)] =
+    theString.zipAll(other, thisElem, otherElem)
+
+  /**
+    * Returns a <code>NonEmptyString</code> formed from this <code>NonEmptyString</code> and another <code>NonEmptyString</code> combining corresponding
+    * elements in pairs. If one of the two <code></code> is shorter than the other, placeholder elements will be used to extend the
+    * shorter collection to the length of the longer.
+    *
+    * @param other the <code>NonEmptyString</code> providing the second half of each result pair
+    * @param thisElem the character to be used to fill up the result if this <code>NonEmptyString</code> is shorter than <code>that</code> <code>NonEmptyString</code>.
+    * @param otherElem the character to be used to fill up the result if <code>that</code> <code>Iterable</code> is shorter than this <code>NonEmptyString</code>.
+    * @return a new <code>NonEmptyString</code> containing pairs consisting of corresponding characters of this <code>NonEmptyString</code> and <code>that</code>. The
+    *     length of the returned collection is the maximum of the lengths of this <code>NonEmptyString</code> and <code>that</code>. If this <code>NonEmptyString</code>
+    *     is shorter than <code>that</code>, <code>thisElem</code> values are used to pad the result. If <code>that</code> is shorter than this
+    *     <code>NonEmptyString</code>, <code>thatElem</code> values are used to pad the result.
+    */
+  def zipAll(other: NonEmptyString, thisElem: Char, otherElem: Char): Iterable[(Char, Char)] =
+    theString.zipAll(other.theString, thisElem, otherElem)
+
+  /**
+    * Zips this <code>NonEmptyString</code>  with its indices.
+    *
+    * @return A new <code>NonEmptyString</code> containing pairs consisting of all elements of this <code>NonEmptyString</code> paired with their index. Indices start at 0.
+    */
+  def zipWithIndex: Iterable[(Char, Int)] = theString.zipWithIndex
+}
+
+/**
+  * Companion object for class <code>NonEmptyString</code>.
+  */
+object NonEmptyString {
+  /**
+    * Constructs a new <code>NonEmptyString</code> given at least one character.
+    *
+    * @param firstChar the first character (with index 0) contained in this <code>NonEmptyString</code>
+    * @param otherChars a varargs of zero or more other characters (with index 1, 2, 3, ...) contained in this <code>NonEmptyString</code>
+    */
+  def apply(firstChar: Char, otherChars: Char*): NonEmptyString = new NonEmptyString(firstChar.toString + otherChars.mkString)
+
+  /**
+    * Variable argument extractor for <code>NonEmptyString</code>s.
+    *
+    * @param nonEmptyString: the <code>NonEmptyString</code> containing the elements to extract
+    * @return an <code>Seq</code> containing this <code>NonEmptyString</code>s elements, wrapped in a <code>Some</code> 
+    */
+  //def unapplySeq(nonEmptyString: NonEmptyString): Option[Seq[Char]] = Some(nonEmptyString.theString)
+
+  def unapplySeq(nonEmptyString: NonEmptyString): Option[Seq[String]] = Some(Seq(nonEmptyString.theString))
+
+  /*
+    // TODO: Figure out how to get case NonEmptyString() to not compile
+    def unapplySeq[T](nonEmptyString: NonEmptyString[T]): Option[(T, Seq[T])] = Some(nonEmptyString.head, nonEmptyString.tail)
+  */
+
+  /**
+    * Optionally construct a <code>NonEmptyString</code> containing the characters, if any, of a given <code>Seq</code>.
+    *
+    * @param seq the <code>Seq</code> of <code>Char</code> with which to construct a <code>NonEmptyString</code>
+    * @return a <code>NonEmptyString</code> containing the elements of the given <code>Seq</code>, if non-empty, wrapped in
+    *     a <code>Some</code>; else <code>None</code> if the <code>Seq</code> is empty
+    */
+  def from[T](seq: Seq[Char]): Option[NonEmptyString] =
+    seq.headOption match {
+      case None => None
+      case Some(_) => Some(new NonEmptyString(seq.mkString))
+    }
+}
diff --git a/project/Versions.scala b/project/Versions.scala
index 562456712..d12e54f13 100644
--- a/project/Versions.scala
+++ b/project/Versions.scala
@@ -16,7 +16,7 @@ object V {
   val circe_generic_extras = "0.13.0"
   val circe_derivation = "0.13.0-M2"
   val pureconfig = "0.12.3"
-  val magnolia = "0.14.4"
+  val magnolia = "0.14.5"
   val jawn = "1.0.0"
 
   val http4s = "0.21.1"


Test patch:
diff --git a/fundamentals/fundamentals-collections/src/test/scala/izumi/fundamentals/collections/NonEmptyCollectionsTest.scala b/fundamentals/fundamentals-collections/src/test/scala/izumi/fundamentals/collections/NonEmptyCollectionsTest.scala
new file mode 100644
index 000000000..ec21f9bcc
--- /dev/null
+++ b/fundamentals/fundamentals-collections/src/test/scala/izumi/fundamentals/collections/NonEmptyCollectionsTest.scala
@@ -0,0 +1,42 @@
+package izumi.fundamentals.collections
+
+import izumi.fundamentals.collections.nonempty.{NonEmptyList, NonEmptyMap, NonEmptySet, NonEmptyString}
+import org.scalatest.wordspec.AnyWordSpec
+
+import scala.collection.compat._
+
+class NonEmptyCollectionsTest extends AnyWordSpec {
+  "NonEmptyList" should {
+    "maintain base contracts" in {
+      val nl = NonEmptyList(1)
+      assert(nl.to(List) == List(1))
+      assert(nl.head == 1)
+      assert(nl.last == 1)
+    }
+  }
+
+  "NonEmptySet" should {
+    "maintain base contracts" in {
+      val nl = NonEmptySet(1, 1)
+      assert(nl.to(Set) == Set(1))
+      assert(nl.head == 1)
+      assert(nl.last == 1)
+    }
+  }
+
+  "NonEmptyString" should {
+    "maintain base contracts" in {
+      assert(NonEmptyString.from("").isEmpty)
+      assert(NonEmptyString.from("abc").exists(_.theString == "abc"))
+    }
+  }
+
+  "NonEmptyMap" should {
+    "maintain base contracts" in {
+      assert(NonEmptyMap((1, "x")).toMap == Map((1, "x")))
+      assert(NonEmptyMap.from[Nothing, Nothing](Map.empty).isEmpty)
+    }
+  }
+
+}
+