{"id":15653265,"url":"https://github.com/dgroup/enumerable4j","last_synced_at":"2025-04-30T21:34:27.430Z","repository":{"id":41951899,"uuid":"345101730","full_name":"dgroup/enumerable4j","owner":"dgroup","description":"Amazing Ruby's \"Enumerable\" ported to Java","archived":false,"fork":false,"pushed_at":"2023-08-28T19:34:47.000Z","size":211,"stargazers_count":29,"open_issues_count":14,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-30T20:05:42.023Z","etag":null,"topics":["collection","elegantobjects","enumerable","java","java-collections","java-collections-framework","library","ruby","ruby-to-java","streamex","streams","streams-api"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dgroup.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"license.txt","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-03-06T13:33:28.000Z","updated_at":"2024-01-14T00:02:09.000Z","dependencies_parsed_at":"2024-10-23T03:35:15.271Z","dependency_job_id":"cd828dd4-8cf4-4cd6-a7e7-74a6796e0e24","html_url":"https://github.com/dgroup/enumerable4j","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgroup%2Fenumerable4j","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgroup%2Fenumerable4j/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgroup%2Fenumerable4j/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgroup%2Fenumerable4j/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dgroup","download_url":"https://codeload.github.com/dgroup/enumerable4j/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251785949,"owners_count":21643585,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["collection","elegantobjects","enumerable","java","java-collections","java-collections-framework","library","ruby","ruby-to-java","streamex","streams","streams-api"],"created_at":"2024-10-03T12:45:10.314Z","updated_at":"2025-04-30T21:34:27.402Z","avatar_url":"https://github.com/dgroup.png","language":"Java","readme":"[![Maven](https://img.shields.io/maven-central/v/io.github.dgroup/enumerable4j.svg)](https://mvnrepository.com/artifact/io.github.dgroup/enumerable4j)\n[![Javadocs](http://www.javadoc.io/badge/io.github.dgroup/enumerable4j.svg)](http://www.javadoc.io/doc/io.github.dgroup/enumerable4j)\n[![License: MIT](https://img.shields.io/github/license/mashape/apistatus.svg)](./license.txt)\n[![Commit activity](https://img.shields.io/github/commit-activity/y/dgroup/enumerable4j.svg?style=flat-square)](https://github.com/dgroup/enumerable4j/graphs/commit-activity)\n[![Hits-of-Code](https://hitsofcode.com/github/dgroup/enumerable4j)](https://hitsofcode.com/view/github/dgroup/enumerable4j)\n\n[![CI](https://github.com/dgroup/enumerable4j/actions/workflows/build.yml/badge.svg)](https://github.com/dgroup/enumerable4j/actions/workflows/build.yml)\n[![0pdd](http://www.0pdd.com/svg?name=dgroup/enumerable4j)](http://www.0pdd.com/p?name=dgroup/enumerable4j)\n[![Dependency Status](https://requires.io/github/dgroup/enumerable4j/requirements.svg?branch=master)](https://requires.io/github/dgroup/enumerable4j/requirements/?branch=master)\n[![Known Vulnerabilities](https://snyk.io/test/github/dgroup/enumerable4j/badge.svg)](https://snyk.io/org/dgroup/project/4a9f3433-7da5-4c24-985e-ee1d3077c458/?tab=dependencies\\\u0026vulns=vulnerable)\n\n[![DevOps By Rultor.com](http://www.rultor.com/b/dgroup/enumerable4j)](http://www.rultor.com/p/dgroup/enumerable4j)\n[![EO badge](http://www.elegantobjects.org/badge.svg)](http://www.elegantobjects.org/#principles)\n[![We recommend IntelliJ IDEA](http://www.elegantobjects.org/intellij-idea.svg)](https://www.jetbrains.com/idea/)\n\n[![Qulice](https://img.shields.io/badge/qulice-passed-blue.svg)](http://www.qulice.com/)\n[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=dgroup_enumerable4j\\\u0026metric=sqale_rating)](https://sonarcloud.io/dashboard?id=dgroup_enumerable4j)\n[![Codebeat Badge](https://codebeat.co/badges/ef2fc64b-b2cf-4cc5-8b01-c9b4baaae87a)](https://codebeat.co/projects/github-com-dgroup-enumerable4j-master)\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/eb956780f5b34519ac193c204062acae)](https://www.codacy.com/gh/dgroup/enumerable4j/dashboard?utm_source=github.com\\\u0026utm_medium=referral\\\u0026utm_content=dgroup/enumerable4j\\\u0026utm_campaign=Badge_Grade)\n[![Codecov](https://codecov.io/gh/dgroup/enumerable4j/branch/master/graph/badge.svg)](https://codecov.io/gh/dgroup/enumerable4j)\n\n*   [Overview](#overview)\n\n*   [How to use?](#how-to-use)\n    *   [.all](#all)\n    *   [.any](#any)\n    *   [.none](#none)\n    *   [.select](#select)\n    *   [.map](#map)\n    *   [.count](#count)\n    *   [.reject](#reject)\n    *   [.find](#find)\n    *   [.reduce](#reduce)\n    *   [.after](#after)\n    *   [.next](#next)\n    *   [.chain](#chain)\n    *   [.each](#each)\n    *   [.take](#take)\n    *   [.drop](#drop)\n    *   [.one](#one)\n    *   [.uniq](#uniq)\n    *   [.zip](#zip)\n\n*   [How to contribute?](#how-to-contribute)\n\n*   [Contributors](#contributors)\n\n### Overview\n\n**enumerable4j** is a Ruby's well known [Enumerable](https://ruby-doc.org/core-2.6/Enumerable.html)\nported to `java` as interface with set of default methods which simplify typical operations with collections.\n```java\n/**\n * The iterable with primitive operations witch simplify typical actions like count, map, etc.\n *\n * The API is based on Ruby's Enumerable:\n *  https://ruby-doc.org/core-2.6/Enumerable.html.\n *\n * The Enumerable provides methods with several traversal and searching features, and with the\n * ability to sort. The class must provide a method each, which yields successive members of the\n * collection.\n *\n * @param \u003cT\u003e The type of entities.\n * @since 0.1.0\n */\npublic interface Enumerable\u003cT\u003e extends Collection\u003cT\u003e {\n    /**\n     * Passes each element of the collection to the each given function.\n     * The given null predicates are skipped.\n     * If no predicate (null) is given, then false is returned instead.\n     * @param first The function to match each element.\n     * @param other The array of functions to match each element.\n     * @return True if the functions never return false.\n     */\n    default boolean all(Predicate\u003cT\u003e first, Predicate\u003cT\u003e... other) {\n        // ...\n    }\n\n    /**\n     * Passes at least one element of the collection to the each given function.\n     * The given null predicates are skipped.\n     * If no predicate (null) is given, then false is returned instead.\n     * @param first The function to match at least one element.\n     * @param other The array of functions to match at least one element.\n     * @return True if functions never return true at least once.\n     */\n    default boolean any(Predicate\u003cT\u003e first, Predicate\u003cT\u003e... other) {\n        // ...\n    }\n\n    /**\n     * Doesn't passes elements of the collection to the each given function.\n     * The given null predicates are skipped.\n     * If no predicate (null) is given, then true is returned instead.\n     * @param first The function to match none elements.\n     * @param other The array of functions to match none elements.\n     * @return True if the functions never returns false or nil.\n     */\n    default boolean none(Predicate\u003cT\u003e first, Predicate\u003cT\u003e... other) {\n        // ...\n    }\n\n    /**\n     * Returns an enumerable containing all elements of enumerable for which the given functions\n     *  return a true value.\n     * The given null predicates are skipped.\n     * If no predicate (null) is given, then an empty enumerable is returned instead.\n     * @param first The function to match each element.\n     * @param other The array of functions to match each element.\n     * @return The enumerable.\n     */\n    default Enumerable\u003cT\u003e select(Predicate\u003cT\u003e first, Predicate\u003cT\u003e... other) {\n        // ...\n    }\n\n    /**\n     * Returns an enumerable containing all elements of enumerable for which the given function\n     *  returns a false value.\n     * The given null predicates are skipped.\n     * If no predicate (null) is given, then 'this' is returned instead.\n     * @param first The function to match each element.\n     * @param other The array of functions to match each element.\n     * @return The enumerable.\n     */\n    default Enumerable\u003cT\u003e reject(Predicate\u003cT\u003e first, Predicate\u003cT\u003e... other) {\n        // ...\n    }\n\n    /**\n     * Returns an enumerable containing first element of enumerable for which the given function\n     *  returns a true value.\n     * The given null predicates are skipped.\n     * If no predicate (null) is given, or no element found then null is returned instead.\n     * @param first The function to match each element.\n     * @param other The array of functions to match each element.\n     * @return The first element of enumerable, that matches predicate.\n     */\n    default T find(Predicate\u003cT\u003e first, Predicate\u003cT\u003e... other) {\n        // ...\n    }\n\n    /**\n     * Returns an enumerable containing first element of enumerable for which the given function\n     *  returns a true value.\n     * The given null predicates are skipped.\n     * If no predicate (null) is given, or no element found then alternative is returned instead.\n     * @param alt The alternative to return in case of null predicate or no element found.\n     * @param first The function to match each element.\n     * @param other The array of functions to match each element.\n     * @return The first element of enumerable, that matches predicate.\n     */\n    default T find(X alt, Predicate\u003cT\u003e first, Predicate\u003cT\u003e... other) {\n        // ...\n    }\n\n    /**\n     * Returns an enumerable containing all elements, on which given function was applied.\n     * If no function (null) is given, then 'this' is returned instead.\n     * @param fnc The function to apply to each element.\n     * @param \u003cR\u003e The type of target entity.\n     * @return The enumerable.\n     */\n    default \u003cR\u003e Enumerable\u003cR\u003e map(Function\u003c? super T, ? extends R\u003e fnc) {\n        // ...\n    }\n\n    /**\n     * Returns the number of elements that are present in enumerable for which the given\n     * function return true.\n     * The given null predicates are skipped.\n     * If no function (null) is given, then 0 is returned instead.\n     * @param first The function to match each element.\n     * @param other The array of functions to match each element.\n     * @return Number of elements satisfying the given function.\n     */\n    default long count(Predicate\u003cT\u003e first, Predicate\u003cT\u003e... other) {\n        // ...\n    }\n\n    /**\n     * Returns a result of the reduction of the elements in this stream,\n     * using provided identity value and accumulation function operator.\n     * If no function (null) is given, then identity is returned instead.\n     * @param idn The identity value of the accumulation function.\n     * @param opr The accumulation function operator which combining previous and current values.\n     * @return Result of of combining elements.\n     */\n    default T reduce(T idn, BinaryOperator\u003cT\u003e opr) {\n        // ...\n    }\n\n    /**\n     * Returns an enumerable containing all elements of enumerable\n     *  after the first one which corresponds the condition.\n     * If no predicate (null) is given, then empty enumerable is returned instead.\n     * @param prd The function to match element after which enumerable elements should be returned.\n     * @return The enumerable.\n     */\n    default Enumerable\u003cT\u003e after(Predicate\u003cT\u003e prd) {\n        // ...\n    }\n\n    /**\n     * Returns an enumerable containing a certain number of elements of enumerable\n     *  after the first one which corresponds the condition.\n     * If no predicate (null) is given, then empty enumerable is returned instead.\n     * @param prd The function to match element after which enumerable elements should be returned.\n     * @param size The number of elements the enumerable should be limited to.\n     * @return The enumerable.\n     * @throws IllegalArgumentException If the size is negative.\n     */\n    default Enumerable\u003cT\u003e after(Predicate\u003cT\u003e prd, long size) {\n        // ...\n    }\n\n    /**\n     * Returns the next element of enumerable after the first one which corresponds the condition.\n     * If no predicate (null) is given, or no element found then null is returned instead.\n     * @param prd The function to match element after which enumerable element should be returned.\n     * @return The next element of enumerable after the first one which corresponds the condition.\n     */\n    default T next(Predicate\u003cT\u003e prd) {\n        // ...\n    }\n\n    /**\n     * Returns the next element of enumerable after the first one which corresponds the condition.\n     * If no predicate (null) is given, or no element found then alternative is returned instead.\n     * @param prd The function to match element after which enumerable element should be returned.\n     * @param alt The alternative to return in case of null predicate or no element found.\n     * @return The next element of enumerable after the first one which corresponds the condition.\n     */\n    default T next(Predicate\u003cT\u003e prd, T alt) {\n        // ...\n    }\n\n    /**\n     * Returns a new enumerable which contains the items of the original collection\n     *  and the added items of the given enumerable.\n     * If no enumerable (null) is given, then 'this' is returned instead.\n     * @param enm The given enumerable.\n     * @return The enumerable.\n     */\n    default Enumerable\u003cT\u003e chain(Enumerable\u003cT\u003e enm) {\n        // ...\n    }\n\n    /**\n     * Returns an enumerable consisting of the elements of the collection,\n     *  additionally performing the provided action on each element of the enumerable.\n     * @param act An action to perform on the elements.\n     * @return The enumerable.\n     */\n    default Enumerable\u003cT\u003e each(Consumer\u003cT\u003e act) {\n        // ...\n    }\n    \n    /**\n     * Returns an enumerable containing first elements of specified size from the enumerable.\n     * @param num The number of elements the enumerable should be limited to.\n     * @return The enumerable.\n     * @throws IllegalArgumentException If the size is negative.\n     */\n    default Enumerable\u003cT\u003e take(long num) {\n        // ...\n    }\n\n    /**\n     * Drops first elements of specified size,\n     *  and returns an enumerable containing the rest of the elements.\n     * @param num The number of elements to be dropped.\n     * @return The enumerable.\n     * @throws IllegalArgumentException If the size is negative.\n     */\n    default Enumerable\u003cT\u003e drop(long num) {\n        // ...\n    }\n\n    /**\n     * The method returns true if the functions return true exactly once.\n     * The given null predicates are skipped.\n     * If no predicate (null) is given, then false is returned instead.\n     * @param first The function to match each element.\n     * @param other The array of functions to match each element.\n     * @return True if the functions returns true exactly once.\n     */\n    default boolean one(Predicate\u003cT\u003e first, Predicate\u003cT\u003e... other) {\n        // ...\n    }\n\n    /**\n     * Returns a new enumerable containing the unique elements.\n     * It compares values using the {@link #hashCode} and {@link #equals} methods for efficiency.\n     * @return The enumerable.\n     */\n    default Enumerable\u003cT\u003e uniq() {\n        // ...\n    }\n\n    /**\n     * Returns a new enumerable containing the unique elements which corresponds the condition\n     *  of the given function.\n     * If no function (null) is given, then empty enumerable is returned instead.\n     * @param fnc The function to apply to each element.\n     * @param \u003cR\u003e The type of function result entity.\n     * @return The enumerable.\n     */\n    default \u003cR\u003e Enumerable\u003cT\u003e uniq(Function\u003c? super T, ? extends R\u003e fnc) {\n        // ...\n    }\n\n    /**\n     * Returns an enumerable of collections which contains each element of original collection\n     *  and corresponding elements from each argument collections.\n     * The length of the resulting enumerable is {@link Enumerable#size}.\n     * If the size of any argument is less than {@link Enumerable#size}, null values are supplied.\n     * @param first The array of enumerable to merge.\n     * @param other The array of enumerable to merge.\n     * @return The enumerable.\n     */\n    default Enumerable\u003cEnumerable\u003cT\u003e\u003e zip(Enumerable\u003cT\u003e first, Enumerable\u003cT\u003e... other) {\n        // ...\n    }\n}\n```\nSee [more](./src/main/java/io/github/dgroup/enumerable4j/Enumerable.java).\n\n### How to use\n\n1.  Get the latest version [here](https://github.com/dgroup/enumerable4j/releases):\n    ```xml\n    \u003cdependency\u003e\n      \u003cgroupId\u003eio.github.dgroup\u003c/groupId\u003e\n      \u003cartifactId\u003eenumerable4j\u003c/artifactId\u003e\n      \u003cversion\u003e${version}\u003c/version\u003e\n    \u003c/dependency\u003e\n    ```\n2.  Assign the [Enumerable](./src/main/java/io/github/dgroup/enumerable4j/Enumerable.java) interface with default methods to your own collection\n    ```java\n    /**\n     * The collection which you implemented in your project for some purposes.\n     */\n    public class YourOwnCollection\u003cT\u003e extends Collection\u003cT\u003e implements Enumerable\u003cT\u003e {\n        //\n    }\n    ```\n    You may (but not required) override the default implementations of methods from [Enumerable](./src/main/java/io/github/dgroup/enumerable4j/Enumerable.java) if needed.\n\n3.  Java version required: 1.8+.\n4.  Comparing matrix with other libs:\n    \n    enumerable4j (MIT) | Java 8 | [cactoos](https://github.com/yegor256/cactoos) (MIT) | [eclipse-collections]() (EDL) \n    |------ | ------ | ------ |------ |\n    `.all(...)` | `.stream().allMatch(...)` | `new And\u003c\u003e(...,...).value()`| tbd |\n    `.any(...)` | `.stream().anyMatch(...)` | `new Or\u003c\u003e(...,...).value()`| tbd |\n    `.none(...)` | `.stream().noneMatch(...)` | `new And\u003c\u003e(...,...).value()`| tbd |\n    `.select(...)` | `.stream().filter(...).collect(Collectors.toList())` | `new Filtered\u003c\u003e(...,...)` | tbd |\n    `.reject(...)` | `.stream().filter((...).negate()).collect(Collectors.toList())` | `new Filtered\u003c\u003e(...,...)` | tbd |\n    `.map(...)` | `.stream().map(...).collect(Collectors.toList())` | `new Mapped\u003c\u003e(...,...)` | tbd |\n    `.count(...)` | `.stream().filter(...).count()` | `new Filtered\u003c\u003e(...).size()` | tbd |\n    `.find(...)` | `.stream().filter(...).findFirst().orElse(...)` | `new FirstOf\u003c\u003e(...,...).value()` | tbd |\n    `.reduce(...,...)` | `.stream().reduce(...,...)` | `new Reduced\u003c\u003e(...,...).value()` | tbd |\n    `.after(...)` | | | tbd |\n    `.next(...)` | | | tbd |\n    `.chain(...)` | | | tbd |\n    `.each(...)` | `.stream().forEach(...)` | `new ForEach\u003c\u003e(...).exec(...)` | tbd |\n    `.take(...)` | `.stream().limit(...).collect(Collectors.toList())` | `new Sliced\u003c\u003e(0,...,...)` | tbd |\n    `.drop(...)` | `.stream().skip(...).collect(Collectors.toList())` | `new Sliced\u003c\u003e(...,...,...)`| tbd |\n    `.one(...)` | `.stream().filter(...).count() == 1` | `new Filtered\u003c\u003e(...).size() == 1` | tbd |\n    `.uniq(...)` | `.stream().skip(...).collect(Collectors.toSet())` | | tbd |\n    `.zip(...)` | | | tbd |\n\n#### .all\n\n```java\nYourOwnCollection\u003cInteger\u003e src = ...           // with elements [1, 2, 3]   \nboolean allPositive = src.all(val -\u003e val \u003e 0); // true \n```\n\n#### .any\n\n```java\nYourOwnCollection\u003cInteger\u003e src = ...             // with elements [-1, 0, 1]\nboolean oneIsPositive = src.any(val -\u003e val \u003e 0); // true \n```\n\n#### .none\n\n```java\nYourOwnCollection\u003cInteger\u003e src = ...               // with elements [-2, -1, 0]\nboolean noneIsPositive = src.none(val -\u003e val \u003e 0); // true \n```\n\n#### .select\n\n```java\nYourOwnCollection\u003cInteger\u003e src = ...                       // with elements [-1, 1, 2]\nEnumerable\u003cInteger\u003e positive = src.select(val -\u003e val \u003e 0); // [1, 2] \n```\n\n#### .reject\n\n```java\nYourOwnCollection\u003cInteger\u003e src = ...                       // with elements [-1, 1, 2]\nEnumerable\u003cInteger\u003e negative = src.reject(val -\u003e val \u003e 0); // [-1]\n```\n\n#### .map\n\n```java\nYourOwnCollection\u003cInteger\u003e src = ...                    // with elements [0, 1, 2]\nEnumerable\u003cInteger\u003e positive = src.map(val -\u003e val + 1); // [1, 2, 3] \n```\n\n#### .count\n\n```java\nYourOwnCollection\u003cInteger\u003e src = ...            // with elements [-1, 0, 1]\nlong countNegative = src.count(val -\u003e val \u003c 0); // 1\n```\n\n#### .find\n\n```java\nYourOwnCollection\u003cInteger\u003e src = ...                // with elements [-1, 0, 1]\nInteger first = src.find(val -\u003e val \u003e 0);           // 1 \nInteger alternative = src.find(50, val -\u003e val \u003e 5); // 50                \n```\n\n#### .reduce\n\n```java\nYourOwnCollection\u003cInteger\u003e src = ...       // with elements [1, 2, 3]   \nInteger sum = src.reduce(0, Integer::sum); // 6 \n```\n\n#### .after\n\n```java\nYourOwnCollection\u003cInteger\u003e src = ...                                    // with elements [2, 3, 4, 5, 6]\nEnumerable\u003cInteger\u003e afterThree = src.after(val -\u003e val == 3);            // [4, 5, 6] \nEnumerable\u003cInteger\u003e firstTwoAfterThree = src.after(val -\u003e val == 3, 2); // [4, 5]                \n```\n\n#### .next\n\n```java\nYourOwnCollection\u003cInteger\u003e src = ...                // with elements [1, 2, 3, 4]\nInteger next = src.next(val -\u003e val == 2);           // 3\nInteger alternative = src.next(val -\u003e val \u003e 5, -1); // -1                \n```\n\n#### .chain\n\n```java\nYourOwnCollection\u003cInteger\u003e src = ...                                               // with elements [1, 2]\nEnumerable\u003cInteger\u003e joined = src.chain(new Linked\u003c\u003e(3)).chain(new Linked\u003c\u003e(4, 5)); // [1, 2, 3, 4, 5] \n```\n\n#### .each\n\n```java\nYourOwnCollection\u003cInteger\u003e src = ...                   // with elements [1, 2, 3]\nEnumerable\u003cInteger\u003e buf = src.each(System.out::print); // [1, 2, 3] , printed: \"123\"\n```\n\n#### .take\n\n```java\nYourOwnCollection\u003cInteger\u003e src = ...     // with elements [1, 2, 3]\nEnumerable\u003cInteger\u003e taken = src.take(2); // [1, 2]\n```\n\n#### .drop\n\n```java\nYourOwnCollection\u003cInteger\u003e src = ...     // with elements [1, 2, 3]\nEnumerable\u003cInteger\u003e taken = src.drop(2); // [3]\n```\n\n#### .one\n\n```java\nYourOwnCollection\u003cInteger\u003e src = ...           // with elements [-1, 0, 1]\nboolean onePositive = src.one(val -\u003e val \u003e 0); // true\n```\n\n#### .uniq\n\n```java\nYourOwnCollection\u003cLinked\u003cInteger\u003e\u003e src = ...                             // with elements [[1, 2], [3, 4], [1, 2], [3, 4, 5]]\nEnumerable\u003cLinked\u003cInteger\u003e\u003e unique = src.uniq();                       // [[1, 2], [3, 4], [3, 4, 5]]\nEnumerable\u003cLinked\u003cInteger\u003e\u003e uniqueByKey = src.uniq(enm -\u003e enm.get(0)); // [[1, 2], [3, 4]]\n```\n\n#### .zip\n\n```java\nYourOwnCollection\u003cInteger\u003e src = ...                 // with elements [1, 2, 3]\nYourOwnCollection\u003cInteger\u003e src2 = ...                // with elements [4, 5, 6]\nEnumerable\u003cEnumerable\u003cInteger\u003e\u003e zip = src.zip(src2); // [[1, 4]], [2, 5], [3, 6]]\n```\n\n### How to contribute?\n\n[![EO badge](http://www.elegantobjects.org/badge.svg)](http://www.elegantobjects.org/#principles)\n\n1.  Pull requests are welcome! Don't forget to add your name to contribution section and run this,\n    beforehand:\n    ```bash\n    mvn -Pqulice clean install\n    ```\n2.  Everyone interacting in this project’s codebases, issue trackers, chat rooms is expected to\n    follow the [code of conduct](.github/CODE_OF_CONDUCT.md).\n3.  Latest maven coordinates [here](https://github.com/dgroup/enumerable4j/releases):\n    ```xml\n    \u003cdependency\u003e\n        \u003cgroupId\u003eio.github.dgroup\u003c/groupId\u003e\n        \u003cartifactId\u003eenumerable4j\u003c/artifactId\u003e\n        \u003cversion\u003e${version}\u003c/version\u003e\n    \u003c/dependency\u003e\n    ```\n\n### Contributors\n\n*   [dgroup](https://github.com/dgroup) as Yurii Dubinka (\u003cyurii.dubinka@gmail.com\u003e)\n*   [smithros](https://github.com/smithros) as Rostyslav Koval (\u003ckovalr2000@gmail.com\u003e)\n*   [ashutosh](https://github.com/singhashutosh96) as Ashutosh Singh (\u003cs.ashutosh@hotmail.com\u003e)\n*   [dykov](https://github.com/dykov) as Oleksii Dykov (\u003cdykovoleksii@gmail.com\u003e)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdgroup%2Fenumerable4j","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdgroup%2Fenumerable4j","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdgroup%2Fenumerable4j/lists"}