@aNNiMON aNNiMON released this Jul 25, 2018 · 8 commits to master since this release

Assets 6
  • Added ofNullable for primitive Optionals (thanks to @mannodermaus)
  • Added filterIndexed, mapIndexed, forEachIndexed operators to primitive streams (thanks to @PromanSEW)
  • Added an ability to combine multiple predicates (thanks to @SunnyJithin for suggestion)
  • Added isEmpty method for Optionals (from Java 11)

@aNNiMON aNNiMON released this Apr 12, 2018 · 21 commits to master since this release

Assets 6
  • Added Optional.mapToBoolean (thanks to @bejibx)
  • Added Stream.equalsOnly operator (thanks to @operando)
  • Added deepEquals, requireNonNullElse, requireNonNullElseGet, isNull, nonNull and requireNonNullElements methods to Objects (thanks @ened for suggestion)
  • Added orElseThrow() method to Optional classes. Please, prefer this method instead of get() as it better reflects the behavior of the method
  • Added toUnmodifiableList(), toUnmodifiableSet() and toUnmodifiableMap() collectors from Java 10 (thanks to @javadev and @PromanSEW). See PromanSEW's comment
  • The Collectors.toMap implementation was changed to match Java 8 specs. toMap(keyMapper), toMap(keyMapper, valueMapper) and toMap(keyMapper, valueMapper, mapFactory) now disallows duplicate keys. If the mapped keys contain duplicates, use new toMap(keyMapper, valueMapper, mergeFunction) and toMap(keyMapper, valueMapper, mergeFunction, mapFactory) methods
  • Removed useless FunctionalInterface annotation
  • Removed deprecated Stream.getIterator method

@aNNiMON aNNiMON released this Sep 20, 2017 · 46 commits to master since this release

Assets 6
  • Added custom operators for Optionals (thanks to @dr-projectiro for suggestion)
  • Added filterNot for Optionals
  • Added Stream.merge operator (thanks to @landawn)
  • Added Stream.concat for iterators
  • Added Stream.ofNullable for array, map and iterator (thanks to @petnagy)
  • Added Collectors.partitioningBy
  • Added getOrElse(Supplier), isPresent and custom operators support for Exceptional (thanks to @PromanSEW)

@aNNiMON aNNiMON released this Jun 24, 2017 · 70 commits to master since this release

Assets 6
  • Added findIndexed operator. Thanks to @PromanSEW
  • Added an ability to run action after closing streams. Stream classes now implements Closeable, close and onClose methods are added. Thanks to @frett
    Notice that it is not necessary to close all streams. Please, refer to official Stream API documentation: https://docs.oracle.com/javase/8/docs/api/java/util/stream/Stream.html
  • Added IntStream ofCodePoints. Thanks to @arturogutierrez
  • Added OptionalBoolean and boolean functional interfaces. Thanks to @PromanSEW
  • Added distinctBy and findLast operators. Small optimization of distinct operator. Thanks to @landawn


  • Added OptionalBooleanMatcher

@aNNiMON aNNiMON released this Mar 24, 2017 · 98 commits to master since this release

Assets 6
  • Added primitive throwable interfaces and Util.safe converters. Thanks to @PromanSEW
  • Improved comparators chaining in ComparatorCompat . Thanks to @BattleShipPark
  • Fixed filter operator in primitive streams. Thanks to @RomainPiel
  • Removed deprecated Stream.ofRange methods.
  • Iterators moved to separate package.


If you're using PrimitiveIterator, PrimitiveExtIterator or LsaExtIterator to create own custom operators, please, fix imports:

// Before
import com.annimon.stream.PrimitiveIterator;
import com.annimon.stream.LsaExtIterator;

// After
import com.annimon.stream.iterator.PrimitiveIterator;
import com.annimon.stream.iterator.LsaExtIterator;

If you're using ComparatorCompat.chain, see #110


  • StreamMatcher.elements now uses Iterable matcher
  • Removed deprecated StreamMatcher.isNotEmpty method

@aNNiMON aNNiMON released this Mar 1, 2017 · 119 commits to master since this release

Assets 6
  • Added Stream.withoutNulls() Stream.nullsOnly() and Predicate.Util.notNull(). Thanks to @IlyaGulya
  • Added Java 8 Comparator backport. Thanks to @BattleShipPark
  • Added Objects.compareInt and Objects.compareLong — backport of Java 7 Integer.compare and Long.compare
  • Added takeUntil and scan operators
  • Added indexed operators: filterIndexed, mapIndexed, takeWhileIndexed, takeUntilIndexed, dropWhileIndexed, reduceIndexed, forEachIndexed and indexed functional interfaces.
    Many thanks to @dalewking for help and suggestions.
  • Fixed unnecessary boxing in filter, flatMap, scan and single operators of primitive streams.
  • Reduced calls to first iterator in Stream.concat
  • Stream operators now placed into named classes in separate package. It can speed up the execution and improve stack trace readability. See an example.
  • Many other fixes and improvements.


  • Added stream custom operator assertions:

    Stream.range(1, 4).custom(assertElements(contains(1, 2, 3)))
  • Update mockito to 2.7.13

@aNNiMON aNNiMON released this Jan 30, 2017 · 186 commits to master since this release

Assets 6
  • Added Stream.ofNullable(T element) and Stream.ofNullable(iterable) methods
  • Added Stream.toList() which can be much faster and convenient than collect(Collectors.toList()) (thanks to @akonior for both great ideas)
  • Fixed NPE in flatMap iterator of primitive streams
  • New faster implementation of Stream.distinct()
  • Added iterate(T seed, Predicate p, UnaryOperator op) method for all streams

@aNNiMON aNNiMON released this Nov 26, 2016 · 202 commits to master since this release

Assets 6
  • Added LongStream and DoubleStream
  • Added OptionalLong and OptionalDouble
  • Added functional interfaces for operating with long and double primitive types
  • Added Exceptional.of(Throwable) factory method (thanks to @arturdm)
  • Added mapToLong, mapToDouble, flatMapToLong, flatMapToDouble to Stream
  • Added mapToLong, mapToDouble to IntStream
  • Added mapToLong, mapToDouble to Optional
  • Added filter, ifPresentOrElse, mapToLong and mapToDouble methods to OptionalInt
  • Added longs and doubles methods to RandomCompat
  • Fixed IllegalArgumentException in RandomCompat ints method, when bound is greater than max int
  • Fixed IntStream rangeClosed deadlock on Integer.MAX_VALUE bound
  • Stream range and rangeClosed now uses IntStream/LongStream internally
  • Removed unnecessary abstraction in primitive streams
  • Small other optimizations and javadocs fixes


  • Added IntStreamMatcher, LongStreamMatcher and DoubleStreamMatcher
  • Added OptionalLongMatcher, OptionalDoubleMatcher
  • Updated mockito version to 2.2.17

@aNNiMON aNNiMON released this Oct 22, 2016 · 262 commits to master since this release

Assets 6
  • Added summingInt, summingLong, summingDouble, averagingInt, averagingLong, averagingDouble collectors
  • Added flatMapping and filtering collectors, which introduced in Java 9
  • Added ToLongFunction and ToDoubleFunction interfaces
  • Added Optional.mapToInt, OptionalInt.map and OptionalInt.mapToObj methods
  • Added IntStream.single, IntStream.findSingle methods
  • Collectors.counting now uses summingLong to avoid unnecessary boxing
  • Collectors.averaging now deprecated and uses averagingDouble internally, also fixed NaN result for empty stream
  • Improved JavaDocs

@aNNiMON aNNiMON released this Aug 23, 2016 · 298 commits to master since this release

Assets 6

distinct method now preserves order (thanks to @pawelkw for having noticed this issue)
Improved error checking in sample method
Added single and findSingle methods (thanks to @xsveda)
Added recover and recoverWith methods to Exceptional (see #66)
Added executeIfPresent and executeIfAbsent methods to Optional and OptionalInt (see #68)
Added ifPresent method to Exceptional
Ability to invoke zip method with Iterator to prevent unnecessary wraping to Stream
Added index operator to Stream
Other fixes and improvements