{"id":20550827,"url":"https://github.com/artodeschini/javastreamutils","last_synced_at":"2026-04-17T08:32:20.797Z","repository":{"id":177662935,"uuid":"654751823","full_name":"artodeschini/JavaStreamUtils","owner":"artodeschini","description":null,"archived":false,"fork":false,"pushed_at":"2024-04-20T22:44:00.000Z","size":29,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-06T05:45:00.691Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/artodeschini.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"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":"2023-06-16T21:36:17.000Z","updated_at":"2024-04-20T22:44:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"a7ab67e1-4299-425d-b9fb-2c109c904518","html_url":"https://github.com/artodeschini/JavaStreamUtils","commit_stats":null,"previous_names":["artodeschini/javastreamutils"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/artodeschini/JavaStreamUtils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artodeschini%2FJavaStreamUtils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artodeschini%2FJavaStreamUtils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artodeschini%2FJavaStreamUtils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artodeschini%2FJavaStreamUtils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/artodeschini","download_url":"https://codeload.github.com/artodeschini/JavaStreamUtils/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artodeschini%2FJavaStreamUtils/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31921881,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T18:22:33.417Z","status":"online","status_checked_at":"2026-04-17T02:00:06.879Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-11-16T02:27:32.959Z","updated_at":"2026-04-17T08:32:20.777Z","avatar_url":"https://github.com/artodeschini.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Java Stream Utils\n\nThis repository has exemples to use Java Stream and lambda\n\n## requirements\n - Java 8+\n - IDE like as IntellJ or Eclipse\n\n## 1 Operations\n\n#### sample to create Stream instances\n\n[Show Java Code](operations/CreateInstanceOfStream.java)\n\n#### sample to use the method .forEach\n\n[Show Java Code](operations/StreamForEachExemple.java)\n\n#### sample to use the method .collect (trnasform stream in other collection etc)\n\n[Show Java Code](operations/StreamCollectSample.java)\n\n#### sample to use method .toArray (transform stream in array)\n\n[Show Java Code](operations/StreamToArraySample.java)\n\n### sample to use method .map to use a function to transform data\n\n[Show Java Code](operations/StreamMapSample.java)\n\n### sample to use method .flatMap to aggregate many list at one list\n\n[Show Java Code](operations/StreamFlatMapSample.java)\n\n### sample to use method .flatMap to aggregate many list at one list with Custon Object\n\n[Show Java Code](operations/StreamFlatMapCustonObjectSample.java)\n\n### sample to use the methods .count .distinct .sorted\n\n[Show Java Code](operations/StreamDistinctCountSortSample.java)\n\n### sample to use the method .filter with Predicate (result boolean)\n\n[Show Java Code](operations/StreamFilterSample.java)\n\n### sample to use the method reduce sum, max, min all elements\n\n[Show Java Code](operations/StreamReduceSample.java)\n\n### sample to use the methods .anyMatch allMatch and noneMatch\n\n[Show Java Code](operations/StreamMatchSample.java)\n\n### sample to use sum and avg terminal operation\n\n[Show Java Code](terminal/StreamSumAvgSample.java)\n\n## 2 Terminated Operations\n\n### sample to use Collector.joining terminal operation -\u003e concat all elements in on string\n\n[Show Java Code](terminal/StreamJoiningSample.java)\n\n### sample to use Collector.counting terminal operation count elements in stream\n\n[Show Java Code](terminal/StremaCountSample.java)\n\n### sample to use Collector.maxBy and Collector.minBy\n\n[Show Java Code](terminal/StreamMinMaxSample.java)\n\n### sample to use Collector.groupingBy age show all information\n\n[Show Java Code](terminal/StreamGrupingBySample.java)\n\n### sample to use Collector.groupingBy age show count occurrences\n\n[Show Java Code](terminal/StreamGrupingBySample2.java)\n\n### sample to use Collector.groupingBy age show show List of names \n\n[Show Java Code](terminal/StreamGrupingBySample3.java)\n\n### sample to use Collector.partitioningBy with integrs\n\n[Show Java Code](terminal/StreamPartitioningBySample.java)\n\n### sample to use Collector.partitioningBy with strins\n\n[Show Java Code](terminal/StreamPartitioningBySample2.java)\n\n## 3 Numerical Stream IntStream LongStream and DoubleStream\n\n### sample to use NumericStream range tangeClose count and ForEach methods\n\n[Show Java Code](numeric/NumericStreamRangeRangeCloseCountForEach.java)\n\n### sample to use NumericStream sum max min average methods\n\n[Show Java Code](numeric/NumericStreamSumMaxMinAverageSample.java)\n\n### sample to use NumericStream boxing and unboxing with mapToInt method\n\n[Show Java Code](numeric/NumericSreamBoxingUnboxingMapToInt.java)\n\n### sample to use NumericStream mapToObj mapToDoble mapToLong methods\n\n[Show Java Code](numeric/NumericStreamMapToObjeMapToDoubleMapToLong.java)\n\n## 3 Parallel Processing\n\nParallel strems in Java use the concept of multi-threading to process data concurrently and potentially improve the \noverral performance. The parallel stream framework automatically divides the worload into smaller task and assigns then\nto multiple threads for parallel execution.\n\n### Sequential Stream\n\n* Process elements ina stream in a serial manner, one after another\n* operations are executed in a single thread following the order of the stream\n* suitable for small medium-sized data set or operations where the order of execution is omportant\n* can be created by default when workin with streams\n\n### Parallel Stream\n\n* process elements in a stream concurrently, utilizing mutiple threads\n* operations are divided into multiple tasks then ca be executed simultaneously on diffentes threads\n* suitable for large data set or operations that can be performed independently\n* create by converting a sequential stream to a parallel stream using the parallel() method\n\n### When not use parallel stream\n\n* small data sets\n* sequential dependencies\n* Non-thread-safe operation\n* I/O-bound operations\n* resource constrains\n* order-sensitive operations\n\n### sample to create a parallel stream\n\n[Show Java Code](parallel/CreateParallelStream.java)\n\n### sample to build a parallel stream\n\n[Show Java Code](parallel/BuildParallelStreamPipeLine.java)\n\n### sample to performance parallel stream x sequential stream\n\n[Show Java Code](parallel/StreamPerformaceSample.java)\n\n## 4 Others\n\n### how to generate a stream for randon numbers integers or double\n\n[Show Java Code](others/StreamNumberGenerator.java)\n\n### how to sum with map or reduce\n\n[Show Java Code](others/StreamSumCalculator.java)\n\n### how to find duplicates values\n\n[Show Java Code](others/StreamFindDuplicates.java)\n\n### how to find duplicate form list/array ina custom object\n\n[Show Java Code](others/StreamFindDuplicatesCustonObject.java)\n\n### how to remove duplicates form list / array\n\n[Show Java Code](others/StramRemoveDuplicatesByListOrArray.java)\n\n### find second largest element to use skip\n\n[Show Java Code](others/StreamSecondLargestElement.java)\n\n### list all files in a directory\n\n[Show Java Code](others/StreamFiles.java)\n\n### filter stream with is not in another list\n\n[Show Java Code](others/StreamFilterNotIn.java)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartodeschini%2Fjavastreamutils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fartodeschini%2Fjavastreamutils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartodeschini%2Fjavastreamutils/lists"}