I have some experience with C#'s LINQ and am trying to learn Java 8's stream API. Now in LINQ I regularly use the Single() Method, which picks the one-and-only object out of a sequence and throws an exception if there isn't a one-and-only object in the stream.
Now:
- Am I correct in thinking Java 8's streams don't have such a method?
- Is there a preferred alternative of getting this functionality?
- Is it good idea to implement this myself?