Compare commits

..

2 Commits

Author SHA1 Message Date
allcontributors[bot]
b612de70c3 docs: update .all-contributorsrc [skip ci] 2021-01-26 20:22:04 +00:00
allcontributors[bot]
537da98f22 docs: update README.md [skip ci] 2021-01-26 20:22:03 +00:00
23 changed files with 66 additions and 132 deletions

View File

@@ -1386,24 +1386,6 @@
"contributions": [
"code"
]
},
{
"login": "byoungju94",
"name": "byoungju94",
"avatar_url": "https://avatars.githubusercontent.com/u/42516378?v=4",
"profile": "https://github.com/byoungju94",
"contributions": [
"code"
]
},
{
"login": "moustafafarhat",
"name": "Moustafa Farhat",
"avatar_url": "https://avatars.githubusercontent.com/u/38836727?v=4",
"profile": "https://github.com/moustafafarhat",
"contributions": [
"translation"
]
}
],
"contributorsPerLine": 4,

View File

@@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2014-2021 Ilkka Seppälä
Copyright (c) 2014-2020 Ilkka Seppälä
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@@ -10,12 +10,12 @@
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=iluwatar_java-design-patterns&metric=coverage)](https://sonarcloud.io/dashboard?id=iluwatar_java-design-patterns)
[![Join the chat at https://gitter.im/iluwatar/java-design-patterns](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/iluwatar/java-design-patterns?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-154-orange.svg?style=flat-square)](#contributors-)
[![All Contributors](https://img.shields.io/badge/all_contributors-152-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->
<br/>
Read in different language : [![CN](/assets/flags/CN.png)**CN**](/zh/README.md),[![KR](/assets/flags/KR.png)**KR**](/ko/README.md),[![FR](/assets/flags/FR.png)**FR**](/fr/README.md),[![TR](/assets/flags/TR.png)**TR**](/tr/README.md),[![AR](/assets/flags/AR.png)**AR**](/ar/README.md),
Read in different language : [![CN](/assets/flags/CN.png)**CN**](/zh/README.md),[![KR](/assets/flags/KR.png)**KR**](/ko/README.md),[![FR](/assets/flags/FR.png)**FR**](/fr/README.md),[![TR](/assets/flags/TR.png)**TR**](/tr/README.md),
<br/>
@@ -303,10 +303,6 @@ This project is licensed under the terms of the MIT license.
<td align="center"><a href="https://github.com/demirhalil"><img src="https://avatars1.githubusercontent.com/u/22895118?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Halil Demir</b></sub></a><br /><a href="#translation-demirhalil" title="Translation">🌍</a></td>
<td align="center"><a href="https://github.com/rohit10000"><img src="https://avatars.githubusercontent.com/u/20845565?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Rohit Singh</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=rohit10000" title="Code">💻</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/byoungju94"><img src="https://avatars.githubusercontent.com/u/42516378?v=4?s=100" width="100px;" alt=""/><br /><sub><b>byoungju94</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=byoungju94" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/moustafafarhat"><img src="https://avatars.githubusercontent.com/u/38836727?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Moustafa Farhat</b></sub></a><br /><a href="#translation-moustafafarhat" title="Translation">🌍</a></td>
</tr>
</table>
<!-- markdownlint-restore -->

View File

@@ -213,8 +213,8 @@ Example use cases
## Related patterns
* [Factory Method](https://java-design-patterns.com/patterns/factory-method/)
* [Factory Kit](https://java-design-patterns.com/patterns/factory-kit/)
[Factory Method](https://java-design-patterns.com/patterns/factory-method/)
[Factory Kit](https://java-design-patterns.com/patterns/factory-kit/)
## Credits

View File

@@ -1,42 +0,0 @@
# أنماط التصميم بلغة برمجة الجافا
![Java CI with Maven](https://github.com/iluwatar/java-design-patterns/workflows/Java%20CI%20with%20Maven/badge.svg)
[![License MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/iluwatar/java-design-patterns/master/LICENSE.md)
[![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=iluwatar_java-design-patterns&metric=ncloc)](https://sonarcloud.io/dashboard?id=iluwatar_java-design-patterns)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=iluwatar_java-design-patterns&metric=coverage)](https://sonarcloud.io/dashboard?id=iluwatar_java-design-patterns)
[![Join the chat at https://gitter.im/iluwatar/java-design-patterns](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/iluwatar/java-design-patterns?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-148-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->
# مقدمة
أنماط التصميم هي أفضل التدريبات التي يمكن للمبرمج استخدامها لحل المشكلات الشائعة عند تصميم تطبيق أو نظام.
يمكن لأنماط التصميم تسريع عملية التطوير من خلال توفير نماذج تطوير مجربة ومثبتة ومفيدة.
تساعد إعادة استخدام أنماط التصميم في منع المشكلات الدقيقة التي تسبب مشكلات كبيرة ، كما تعمل على تحسين قابلية قراءة الكود للمهندسين البرمجيات الذين هم على دراية بالأنماط.
# البدء في التعلم
يعرض هذا الموقع أنماط تصميم جافا. تم تطوير الحلول من قبل المبرمجين والمهندسين ذوي الخبرة من مجتمع المصادر المفتوحة. يمكن تصفح الأنماط من خلال أوصافها عالية المستوى أو بالنظر إلى كود المصدر الخاص بها. تم كتابة الشرح على أمثلة الكود المصدري جيدًا ويمكن اعتبارها برامج تعليمية حول كيفية تنفيذ نمط معين. نحن نستخدم تقنيات Java مفتوحة المصدر الأكثر شيوعًا والتي أثبتت جدارتها في مشاريع الجافا.
قبل الغوص في المادة ، يجب أن تكون على دراية [بمبادئ تصميم البرامج المختلفة](https://java-design-patterns.com/principles/).
يجب أن تكون جميع التصميمات بسيطة قدر الإمكان. يجب أن تبدأ بـ KISS و YAGNI وافعل أبسط شيء يمكن أن يعمل بهذه المبادىء. يجب إستخدام الأنماط فقط عند الحاجة إليها من أجل تمديد البرنامج بشكل عملي.
بمجرد أن تصبح معتادًا على هذه المفاهيم ، يمكنك البدء في التعمق في [أنماط التصميم المتاحة](https://java-design-patterns.com/patterns/) من خلال أي من الأساليب التالية
ابحث عن نمط محدد بالاسم. لا يمكنك العثور على واحد؟ الرجاء الإبلاغ عن نمط جديد [هنا](https://github.com/iluwatar/java-design-patterns/issues).
استخدام علامات مثل Performance أو Gang of Four أو الوصول إلى البيانات.
استخدام فئات الأنماط و Creational, Behavioral وغيرها.
نأمل أن تجد الحلول الموجهة للكائنات المعروضة على هذا الموقع مفيدة في مشاريعك البرمجية وأن تستمتع بتعلمها بقدر ما قمنا بتطويرها.
# كيف تساهم؟
إذا كنت على استعداد للمساهمة في المشروع ، فستجد المعلومات ذات الصلة في [ويكي المطور الخاص بنا](https://github.com/iluwatar/java-design-patterns/wiki). سنساعدك ونجيب على أسئلتك في [غرفة الدردشة Gitter](https://gitter.im/iluwatar/java-design-patterns).
# الترخيص
هذا المشروع مرخص بموجب شروط ترخيص MIT.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 252 B

View File

@@ -20,14 +20,12 @@ callbacks or waiting until everything is done.
## Applicability
Use async method invocation pattern when
* You have multiple independent tasks that can run in parallel
* You need to improve the performance of a group of sequential tasks
* You have limited amount of processing capacity or long running tasks and the
* you have multiple independent tasks that can run in parallel
* you need to improve the performance of a group of sequential tasks
* you have limited amount of processing capacity or long running tasks and the
caller should not wait the tasks to be ready
## Real world examples
* [FutureTask](http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/FutureTask.html)
* [CompletableFuture](https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/CompletableFuture.html)
* [ExecutorService](http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ExecutorService.html)
* [Task-based Asynchronous Pattern](https://msdn.microsoft.com/en-us/library/hh873175.aspx)
* [FutureTask](http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/FutureTask.html), [CompletableFuture](https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/CompletableFuture.html) and [ExecutorService](http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ExecutorService.html) (Java)
* [Task-based Asynchronous Pattern](https://msdn.microsoft.com/en-us/library/hh873175.aspx) (.NET)

View File

@@ -23,15 +23,13 @@
package com.iluwatar.caching;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
/**
* Application test
*/
class CachingTest {
public class CachingTest {
private App app;
/**
@@ -49,26 +47,22 @@ class CachingTest {
}
@Test
void testReadAndWriteThroughStrategy() {
assertNotNull(app);
public void testReadAndWriteThroughStrategy() {
app.useReadAndWriteThroughStrategy();
}
@Test
void testReadThroughAndWriteAroundStrategy() {
assertNotNull(app);
public void testReadThroughAndWriteAroundStrategy() {
app.useReadThroughAndWriteAroundStrategy();
}
@Test
void testReadThroughAndWriteBehindStrategy() {
assertNotNull(app);
public void testReadThroughAndWriteBehindStrategy() {
app.useReadThroughAndWriteBehindStrategy();
}
@Test
void testCacheAsideStrategy() {
assertNotNull(app);
public void testCacheAsideStrategy() {
app.useCacheAsideStategy();
}
}

View File

@@ -49,7 +49,7 @@ remote calls.
The service architecture is as follows:
![alt text](./etc/ServiceDiagram.png "Service Diagram")
![alt text](./etc/ServiceDiagram.PNG "Service Diagram")
In terms of code, the end user application is:
@@ -292,7 +292,7 @@ public class DefaultCircuitBreaker implements CircuitBreaker {
How does the above pattern prevent failures? Let's understand via this finite state machine
implemented by it.
![alt text](./etc/StateDiagram.png "State Diagram")
![alt text](./etc/StateDiagram.PNG "State Diagram")
- We initialize the Circuit Breaker object with certain parameters: `timeout`, `failureThreshold` and `retryTimePeriod` which help determine how resilient the API is.
- Initially, we are in the `closed` state and nos remote calls to the API have occurred.

View File

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

View File

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View File

@@ -105,4 +105,4 @@ domain equivalence.
## Credits
* [Converter Pattern in Java 8](http://www.xsolve.pl/blog/converter-pattern-in-java-8/)
* [Converter](http://www.xsolve.pl/blog/converter-pattern-in-java-8/)

View File

@@ -67,7 +67,7 @@ public class DbCustomerDao implements CustomerDao {
public Stream<Customer> getAll() throws Exception {
try {
var connection = getConnection();
var statement = connection.prepareStatement("SELECT * FROM CUSTOMERS"); // NOSONAR
var statement = connection.prepareStatement("SELECT * FROM CUSTOMERS");
var resultSet = statement.executeQuery(); // NOSONAR
return StreamSupport.stream(new Spliterators.AbstractSpliterator<Customer>(Long.MAX_VALUE,
Spliterator.ORDERED) {

View File

@@ -25,7 +25,6 @@
<inceptionYear>2014-2019</inceptionYear>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<sonar-maven-plugin.version>3.8.0.2131</sonar-maven-plugin.version>
<hibernate.version>5.2.18.Final</hibernate.version>
<spring.version>5.0.13.RELEASE</spring.version>
<spring-boot.version>2.0.9.RELEASE</spring-boot.version>
@@ -426,7 +425,7 @@
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>${sonar-maven-plugin.version}</version>
<version>3.7.0.1746</version>
</plugin>
</plugins>
</pluginManagement>

View File

@@ -23,7 +23,7 @@
package com.iluwatar.spatialpartition;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.Random;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -44,11 +44,11 @@ import org.slf4j.LoggerFactory;
* <b>{@link Rect}</b> class to define the boundary of the quadtree. We use an abstract class
* <b>{@link Point}</b>
* with x and y coordinate fields and also an id field so that it can easily be put and looked up in
* the hashmap. This class has abstract methods to define how the object moves (move()), when to
* the hashtable. This class has abstract methods to define how the object moves (move()), when to
* check for collision with any object (touches(obj)) and how to handle collision
* (handleCollision(obj)), and will be extended by any object whose position has to be kept track of
* in the quadtree. The <b>{@link SpatialPartitionGeneric}</b> abstract class has 2 fields - a
* hashmap containing all objects (we use hashmap for faster lookups, insertion and deletion)
* hashtable containing all objects (we use hashtable for faster lookups, insertion and deletion)
* and a quadtree, and contains an abstract method which defines how to handle interactions between
* objects using the quadtree.</p>
* <p>Using the quadtree data structure will reduce the time complexity of finding the objects
@@ -61,7 +61,7 @@ public class App {
private static final Logger LOGGER = LoggerFactory.getLogger(App.class);
private static final String BUBBLE = "Bubble ";
static void noSpatialPartition(int numOfMovements, HashMap<Integer, Bubble> bubbles) {
static void noSpatialPartition(int numOfMovements, Hashtable<Integer, Bubble> bubbles) {
//all bubbles have to be checked for collision for all bubbles
var bubblesToCheck = bubbles.values();
@@ -81,9 +81,9 @@ public class App {
}
static void withSpatialPartition(
int height, int width, int numOfMovements, HashMap<Integer, Bubble> bubbles) {
int height, int width, int numOfMovements, Hashtable<Integer, Bubble> bubbles) {
//creating quadtree
var rect = new Rect(width / 2D, height / 2D, width, height);
var rect = new Rect(width / 2, height / 2, width, height);
var quadTree = new QuadTree(rect, 4);
//will run numOfMovement times or till all bubbles have popped
@@ -110,15 +110,15 @@ public class App {
*/
public static void main(String[] args) {
var bubbles1 = new HashMap<Integer, Bubble>();
var bubbles2 = new HashMap<Integer, Bubble>();
var bubbles1 = new Hashtable<Integer, Bubble>();
var bubbles2 = new Hashtable<Integer, Bubble>();
var rand = new Random();
for (int i = 0; i < 10000; i++) {
var b = new Bubble(rand.nextInt(300), rand.nextInt(300), i, rand.nextInt(2) + 1);
bubbles1.put(i, b);
bubbles2.put(i, b);
LOGGER.info(BUBBLE, i, " with radius ", b.radius,
" added at (", b.coordinateX, ",", b.coordinateY + ")");
LOGGER.info(BUBBLE + i + " with radius " + b.radius
+ " added at (" + b.coordinateX + "," + b.coordinateY + ")");
}
var start1 = System.currentTimeMillis();
@@ -127,8 +127,8 @@ public class App {
var start2 = System.currentTimeMillis();
App.withSpatialPartition(300, 300, 20, bubbles2);
var end2 = System.currentTimeMillis();
LOGGER.info("Without spatial partition takes ", (end1 - start1), "ms");
LOGGER.info("With spatial partition takes ", (end2 - start2), "ms");
LOGGER.info("Without spatial partition takes " + (end1 - start1) + "ms");
LOGGER.info("With spatial partition takes " + (end2 - start2) + "ms");
}
}

View File

@@ -24,7 +24,7 @@
package com.iluwatar.spatialpartition;
import java.util.Collection;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.Random;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -58,13 +58,13 @@ public class Bubble extends Point<Bubble> {
<= (this.radius + b.radius) * (this.radius + b.radius);
}
void pop(HashMap<Integer, Bubble> allBubbles) {
LOGGER.info("Bubble ", this.id,
" popped at (", this.coordinateX, ",", this.coordinateY, ")!");
void pop(Hashtable<Integer, Bubble> allBubbles) {
LOGGER.info("Bubble " + this.id
+ " popped at (" + this.coordinateX + "," + this.coordinateY + ")!");
allBubbles.remove(this.id);
}
void handleCollision(Collection<? extends Point> toCheck, HashMap<Integer, Bubble> allBubbles) {
void handleCollision(Collection<? extends Point> toCheck, Hashtable<Integer, Bubble> allBubbles) {
var toBePopped = false; //if any other bubble collides with it, made true
for (var point : toCheck) {
var otherId = point.id;

View File

@@ -24,7 +24,7 @@
package com.iluwatar.spatialpartition;
import java.util.Collection;
import java.util.HashMap;
import java.util.Hashtable;
/**
* The abstract Point class which will be extended by any object in the field whose location has to
@@ -64,5 +64,5 @@ public abstract class Point<T> {
* @param toCheck contains the objects which need to be checked
* @param all contains hashtable of all points on field at this time
*/
abstract void handleCollision(Collection<? extends Point> toCheck, HashMap<Integer, T> all);
abstract void handleCollision(Collection<? extends Point> toCheck, Hashtable<Integer, T> all);
}

View File

@@ -24,7 +24,7 @@
package com.iluwatar.spatialpartition;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Hashtable;
/**
* This class extends the generic SpatialPartition abstract class and is used in our example to keep
@@ -33,10 +33,10 @@ import java.util.HashMap;
public class SpatialPartitionBubbles extends SpatialPartitionGeneric<Bubble> {
private final HashMap<Integer, Bubble> bubbles;
private final Hashtable<Integer, Bubble> bubbles;
private final QuadTree quadTree;
SpatialPartitionBubbles(HashMap<Integer, Bubble> bubbles, QuadTree quadTree) {
SpatialPartitionBubbles(Hashtable<Integer, Bubble> bubbles, QuadTree quadTree) {
this.bubbles = bubbles;
this.quadTree = quadTree;
}
@@ -44,7 +44,7 @@ public class SpatialPartitionBubbles extends SpatialPartitionGeneric<Bubble> {
void handleCollisionsUsingQt(Bubble b) {
// finding points within area of a square drawn with centre same as
// centre of bubble and length = radius of bubble
var rect = new Rect(b.coordinateX, b.coordinateY, 2D * b.radius, 2D * b.radius);
var rect = new Rect(b.coordinateX, b.coordinateY, 2 * b.radius, 2 * b.radius);
var quadTreeQueryResult = new ArrayList<Point>();
this.quadTree.query(rect, quadTreeQueryResult);
//handling these collisions

View File

@@ -29,7 +29,7 @@ import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Hashtable;
import org.junit.jupiter.api.Test;
/**
@@ -63,11 +63,11 @@ class BubbleTest {
void popTest() {
var b1 = new Bubble(10, 10, 1, 2);
var b2 = new Bubble(0, 0, 2, 2);
var bubbles = new HashMap<Integer, Bubble>();
var bubbles = new Hashtable<Integer, Bubble>();
bubbles.put(1, b1);
bubbles.put(2, b2);
b1.pop(bubbles);
//after popping, bubble no longer in hashMap containing all bubbles
//after popping, bubble no longer in hashtable containing all bubbles
assertNull(bubbles.get(1));
assertNotNull(bubbles.get(2));
}
@@ -77,7 +77,7 @@ class BubbleTest {
var b1 = new Bubble(0, 0, 1, 2);
var b2 = new Bubble(1, 1, 2, 1);
var b3 = new Bubble(10, 10, 3, 1);
var bubbles = new HashMap<Integer, Bubble>();
var bubbles = new Hashtable<Integer, Bubble>();
bubbles.put(1, b1);
bubbles.put(2, b2);
bubbles.put(3, b3);

View File

@@ -26,7 +26,7 @@ package com.iluwatar.spatialpartition;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import java.util.HashMap;
import java.util.Hashtable;
import org.junit.jupiter.api.Test;
/**
@@ -41,7 +41,7 @@ class SpatialPartitionBubblesTest {
var b2 = new Bubble(5, 5, 2, 1);
var b3 = new Bubble(9, 9, 3, 1);
var b4 = new Bubble(8, 8, 4, 2);
var bubbles = new HashMap<Integer, Bubble>();
var bubbles = new Hashtable<Integer, Bubble>();
bubbles.put(1, b1);
bubbles.put(2, b2);
bubbles.put(3, b3);

View File

@@ -38,13 +38,16 @@ public class Db {
*
* @return singleton instance of Db class
*/
public static synchronized Db getInstance() {
public static Db getInstance() {
if (instance == null) {
Db newInstance = new Db();
newInstance.userName2User = new HashMap<>();
newInstance.user2Account = new HashMap<>();
newInstance.itemName2Product = new HashMap<>();
instance = newInstance;
synchronized (Db.class) {
if (instance == null) {
instance = new Db();
instance.userName2User = new HashMap<>();
instance.user2Account = new HashMap<>();
instance.itemName2Product = new HashMap<>();
}
}
}
return instance;
}

View File

@@ -38,9 +38,13 @@ public class MaintenanceLock {
*
* @return singleton instance of MaintenanceLock
*/
public static synchronized MaintenanceLock getInstance() {
public static MaintenanceLock getInstance() {
if (instance == null) {
instance = new MaintenanceLock();
synchronized (MaintenanceLock.class) {
if (instance == null) {
instance = new MaintenanceLock();
}
}
}
return instance;
}
@@ -51,6 +55,6 @@ public class MaintenanceLock {
public void setLock(boolean lock) {
this.lock = lock;
LOGGER.info("Maintenance lock is set to: ", lock);
LOGGER.info("Maintenance lock is set to: " + lock);
}
}

View File

@@ -49,7 +49,7 @@ public class HotelDaoImpl implements HotelDao {
public Stream<Room> getAll() throws Exception {
try {
var connection = getConnection();
var statement = connection.prepareStatement("SELECT * FROM ROOMS"); // NOSONAR
var statement = connection.prepareStatement("SELECT * FROM ROOMS");
var resultSet = statement.executeQuery(); // NOSONAR
return StreamSupport.stream(new Spliterators.AbstractSpliterator<Room>(Long.MAX_VALUE,
Spliterator.ORDERED) {