From 147e2e681ab1e0e87e4aa898f9e4f939207e9060 Mon Sep 17 00:00:00 2001 From: Aparna Date: Sat, 10 Dec 2022 20:25:37 +0530 Subject: [PATCH] feature: added code refactoring changes for 2378 (#2379) * fix:added code refactoring changes for 2378 * fix:added code refactoring changes for 2378 * build fix for 2378 * fix: updated pom.xml files for 2378 issue * fix:build fix for 2378 issue Co-authored-by: aparna --- collecting-parameter/pom.xml | 26 ------------------- .../com/iluwatar/collectingparameter/App.java | 24 ----------------- .../collectingparameter/PrinterItem.java | 2 +- .../iluwatar/collectingparameter/AppTest.java | 24 ----------------- .../FunctionalProgramming.java | 4 +-- combinator/pom.xml | 2 +- .../com/iluwatar/converter/Converter.java | 5 ++-- .../datatransfer/product/ProductResource.java | 5 ++-- .../java/com/iluwatar/fanout/fanin/App.java | 3 +-- .../iluwatar/fanout/fanin/FanOutFanIn.java | 3 +-- .../fanout/fanin/FanOutFanInTest.java | 3 +-- .../SimpleProbabilisticThreatAwareSystem.java | 2 +- .../threat/SimpleThreatAwareSystem.java | 3 +-- .../flux/dispatcher/DispatcherTest.java | 5 ++-- .../layers/service/CakeBakingServiceImpl.java | 3 +-- .../AbstractMessageManager.java | 6 ++--- .../bully/BullyMessageManager.java | 3 +-- .../leaderelection/ring/RingInstance.java | 3 +-- serialized-entity/pom.xml | 26 ------------------- .../com/iluwatar/serializedentity/App.java | 4 ++- .../iluwatar/serializedentity/Country.java | 2 ++ .../iluwatar/serializedentity/CountryDao.java | 2 ++ .../serializedentity/CountrySchemaSql.java | 2 ++ .../serializedentity/CountryTest.java | 2 ++ service-to-worker/pom.xml | 26 +++++++++++++++++++ .../iluwatar/servicetoworker/ActionTest.java | 24 +++++++++++++++++ .../com/iluwatar/servicetoworker/AppTest.java | 24 +++++++++++++++++ .../servicetoworker/DispatcherTest.java | 24 +++++++++++++++++ .../servicetoworker/GiantControllerTest.java | 24 +++++++++++++++++ .../servicetoworker/GiantModelTest.java | 24 +++++++++++++++++ .../servicetoworker/GiantViewTest.java | 24 +++++++++++++++++ .../com/iluwatar/threadpool/TaskTest.java | 2 +- 32 files changed, 202 insertions(+), 134 deletions(-) diff --git a/collecting-parameter/pom.xml b/collecting-parameter/pom.xml index 8f7fdc2b5..09e1860d6 100644 --- a/collecting-parameter/pom.xml +++ b/collecting-parameter/pom.xml @@ -1,30 +1,4 @@ - java-design-patterns diff --git a/collecting-parameter/src/main/java/com/iluwatar/collectingparameter/App.java b/collecting-parameter/src/main/java/com/iluwatar/collectingparameter/App.java index 93ead620d..665e87a7e 100644 --- a/collecting-parameter/src/main/java/com/iluwatar/collectingparameter/App.java +++ b/collecting-parameter/src/main/java/com/iluwatar/collectingparameter/App.java @@ -1,27 +1,3 @@ -/* - * This project is licensed under the MIT license. Module model-view-viewmodel is using ZK framework licensed under LGPL (see lgpl-3.0.txt). - * - * The MIT License - * Copyright © 2014-2022 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 - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ package com.iluwatar.collectingparameter; import java.util.LinkedList; diff --git a/collecting-parameter/src/main/java/com/iluwatar/collectingparameter/PrinterItem.java b/collecting-parameter/src/main/java/com/iluwatar/collectingparameter/PrinterItem.java index 629cdb625..b73776916 100644 --- a/collecting-parameter/src/main/java/com/iluwatar/collectingparameter/PrinterItem.java +++ b/collecting-parameter/src/main/java/com/iluwatar/collectingparameter/PrinterItem.java @@ -31,4 +31,4 @@ public class PrinterItem { this.isDoubleSided = isDoubleSided; } -} +} \ No newline at end of file diff --git a/collecting-parameter/src/test/java/com/iluwatar/collectingparameter/AppTest.java b/collecting-parameter/src/test/java/com/iluwatar/collectingparameter/AppTest.java index 57f903777..d7712584f 100644 --- a/collecting-parameter/src/test/java/com/iluwatar/collectingparameter/AppTest.java +++ b/collecting-parameter/src/test/java/com/iluwatar/collectingparameter/AppTest.java @@ -1,27 +1,3 @@ -/* - * This project is licensed under the MIT license. Module model-view-viewmodel is using ZK framework licensed under LGPL (see lgpl-3.0.txt). - * - * The MIT License - * Copyright © 2014-2022 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 - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ package com.iluwatar.collectingparameter; import org.junit.jupiter.api.Test; diff --git a/collection-pipeline/src/main/java/com/iluwatar/collectionpipeline/FunctionalProgramming.java b/collection-pipeline/src/main/java/com/iluwatar/collectionpipeline/FunctionalProgramming.java index 582bbde36..adf0fda4b 100644 --- a/collection-pipeline/src/main/java/com/iluwatar/collectionpipeline/FunctionalProgramming.java +++ b/collection-pipeline/src/main/java/com/iluwatar/collectionpipeline/FunctionalProgramming.java @@ -56,7 +56,7 @@ public class FunctionalProgramming { public static List getModelsAfter2000(List cars) { return cars.stream().filter(car -> car.getYear() > 2000) .sorted(Comparator.comparing(Car::getYear)) - .map(Car::getModel).collect(Collectors.toList()); + .map(Car::getModel).toList(); } /** @@ -78,6 +78,6 @@ public class FunctionalProgramming { public static List getSedanCarsOwnedSortedByDate(List persons) { return persons.stream().map(Person::getCars).flatMap(List::stream) .filter(car -> Category.SEDAN.equals(car.getCategory())) - .sorted(Comparator.comparing(Car::getYear)).collect(Collectors.toList()); + .sorted(Comparator.comparing(Car::getYear)).toList(); } } diff --git a/combinator/pom.xml b/combinator/pom.xml index 35c2c7dea..0e2f41962 100644 --- a/combinator/pom.xml +++ b/combinator/pom.xml @@ -27,7 +27,7 @@ --> 4.0.0 - + com.iluwatar java-design-patterns 1.26.0-SNAPSHOT diff --git a/converter/src/main/java/com/iluwatar/converter/Converter.java b/converter/src/main/java/com/iluwatar/converter/Converter.java index f4ae9432d..bd7a73f98 100644 --- a/converter/src/main/java/com/iluwatar/converter/Converter.java +++ b/converter/src/main/java/com/iluwatar/converter/Converter.java @@ -27,7 +27,6 @@ package com.iluwatar.converter; import java.util.Collection; import java.util.List; import java.util.function.Function; -import java.util.stream.Collectors; import lombok.RequiredArgsConstructor; /** @@ -74,7 +73,7 @@ public class Converter { * with the conversion function */ public final List createFromDtos(final Collection dtos) { - return dtos.stream().map(this::convertFromDto).collect(Collectors.toList()); + return dtos.stream().map(this::convertFromDto).toList(); } /** @@ -85,7 +84,7 @@ public class Converter { * with the conversion function */ public final List createFromEntities(final Collection entities) { - return entities.stream().map(this::convertFromEntity).collect(Collectors.toList()); + return entities.stream().map(this::convertFromEntity).toList(); } } diff --git a/data-transfer-object/src/main/java/com/iluwatar/datatransfer/product/ProductResource.java b/data-transfer-object/src/main/java/com/iluwatar/datatransfer/product/ProductResource.java index 2c3158fe5..9adafc8be 100644 --- a/data-transfer-object/src/main/java/com/iluwatar/datatransfer/product/ProductResource.java +++ b/data-transfer-object/src/main/java/com/iluwatar/datatransfer/product/ProductResource.java @@ -25,7 +25,6 @@ package com.iluwatar.datatransfer.product; import java.util.List; -import java.util.stream.Collectors; /** * The resource class which serves product information. This class act as server in the demo. Which @@ -54,7 +53,7 @@ public class ProductResource { .map(p -> new ProductDto.Response.Private().setId(p.getId()).setName(p.getName()) .setCost(p.getCost()) .setPrice(p.getPrice())) - .collect(Collectors.toList()); + .toList(); } /** @@ -67,7 +66,7 @@ public class ProductResource { .stream() .map(p -> new ProductDto.Response.Public().setId(p.getId()).setName(p.getName()) .setPrice(p.getPrice())) - .collect(Collectors.toList()); + .toList(); } /** diff --git a/fanout-fanin/src/main/java/com/iluwatar/fanout/fanin/App.java b/fanout-fanin/src/main/java/com/iluwatar/fanout/fanin/App.java index 76d1e6cef..e4d8c93f9 100644 --- a/fanout-fanin/src/main/java/com/iluwatar/fanout/fanin/App.java +++ b/fanout-fanin/src/main/java/com/iluwatar/fanout/fanin/App.java @@ -26,7 +26,6 @@ package com.iluwatar.fanout.fanin; import java.util.Arrays; import java.util.List; -import java.util.stream.Collectors; import lombok.extern.slf4j.Slf4j; @@ -62,7 +61,7 @@ public class App { LOGGER.info("Numbers to be squared and get sum --> {}", numbers); final List requests = - numbers.stream().map(SquareNumberRequest::new).collect(Collectors.toList()); + numbers.stream().map(SquareNumberRequest::new).toList(); var consumer = new Consumer(0L); diff --git a/fanout-fanin/src/main/java/com/iluwatar/fanout/fanin/FanOutFanIn.java b/fanout-fanin/src/main/java/com/iluwatar/fanout/fanin/FanOutFanIn.java index fda840d43..927458321 100644 --- a/fanout-fanin/src/main/java/com/iluwatar/fanout/fanin/FanOutFanIn.java +++ b/fanout-fanin/src/main/java/com/iluwatar/fanout/fanin/FanOutFanIn.java @@ -28,7 +28,6 @@ import java.util.List; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; -import java.util.stream.Collectors; /** * FanOutFanIn class processes long running requests, when any of the processes gets over, result is @@ -54,7 +53,7 @@ public class FanOutFanIn { .map( request -> CompletableFuture.runAsync(() -> request.delayedSquaring(consumer), service)) - .collect(Collectors.toList()); + .toList(); CompletableFuture.allOf(futures.toArray(new CompletableFuture[0])).join(); diff --git a/fanout-fanin/src/test/java/com/iluwatar/fanout/fanin/FanOutFanInTest.java b/fanout-fanin/src/test/java/com/iluwatar/fanout/fanin/FanOutFanInTest.java index 22268fa4e..33315adfd 100644 --- a/fanout-fanin/src/test/java/com/iluwatar/fanout/fanin/FanOutFanInTest.java +++ b/fanout-fanin/src/test/java/com/iluwatar/fanout/fanin/FanOutFanInTest.java @@ -29,7 +29,6 @@ import org.junit.jupiter.api.Test; import java.util.Arrays; import java.util.List; -import java.util.stream.Collectors; class FanOutFanInTest { @@ -38,7 +37,7 @@ class FanOutFanInTest { final List numbers = Arrays.asList(1L, 3L, 4L, 7L, 8L); final List requests = - numbers.stream().map(SquareNumberRequest::new).collect(Collectors.toList()); + numbers.stream().map(SquareNumberRequest::new).toList(); final Consumer consumer = new Consumer(0L); diff --git a/filterer/src/main/java/com/iluwatar/filterer/threat/SimpleProbabilisticThreatAwareSystem.java b/filterer/src/main/java/com/iluwatar/filterer/threat/SimpleProbabilisticThreatAwareSystem.java index 21ed510f9..def1918bb 100644 --- a/filterer/src/main/java/com/iluwatar/filterer/threat/SimpleProbabilisticThreatAwareSystem.java +++ b/filterer/src/main/java/com/iluwatar/filterer/threat/SimpleProbabilisticThreatAwareSystem.java @@ -76,7 +76,7 @@ public class SimpleProbabilisticThreatAwareSystem implements ProbabilisticThreat final Predicate predicate) { return this.threats.stream() .filter(predicate) - .collect(Collectors.toUnmodifiableList()); + .toList(); } } diff --git a/filterer/src/main/java/com/iluwatar/filterer/threat/SimpleThreatAwareSystem.java b/filterer/src/main/java/com/iluwatar/filterer/threat/SimpleThreatAwareSystem.java index a1a621c78..7a27e2328 100644 --- a/filterer/src/main/java/com/iluwatar/filterer/threat/SimpleThreatAwareSystem.java +++ b/filterer/src/main/java/com/iluwatar/filterer/threat/SimpleThreatAwareSystem.java @@ -74,8 +74,7 @@ public class SimpleThreatAwareSystem implements ThreatAwareSystem { private List filteredItems(Predicate predicate) { return this.issues.stream() - .filter(predicate) - .collect(Collectors.toUnmodifiableList()); + .filter(predicate).toList(); } } diff --git a/flux/src/test/java/com/iluwatar/flux/dispatcher/DispatcherTest.java b/flux/src/test/java/com/iluwatar/flux/dispatcher/DispatcherTest.java index 0657e6cf7..8e933a4f7 100644 --- a/flux/src/test/java/com/iluwatar/flux/dispatcher/DispatcherTest.java +++ b/flux/src/test/java/com/iluwatar/flux/dispatcher/DispatcherTest.java @@ -39,7 +39,6 @@ import com.iluwatar.flux.action.ContentAction; import com.iluwatar.flux.action.MenuAction; import com.iluwatar.flux.action.MenuItem; import com.iluwatar.flux.store.Store; -import java.util.stream.Collectors; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.ArgumentCaptor; @@ -90,12 +89,12 @@ class DispatcherTest { final var menuActions = actions.stream() .filter(a -> a.getType().equals(ActionType.MENU_ITEM_SELECTED)) .map(a -> (MenuAction) a) - .collect(Collectors.toList()); + .toList(); final var contentActions = actions.stream() .filter(a -> a.getType().equals(ActionType.CONTENT_CHANGED)) .map(a -> (ContentAction) a) - .collect(Collectors.toList()); + .toList(); assertEquals(2, menuActions.size()); assertEquals(1, menuActions.stream().map(MenuAction::getMenuItem).filter(MenuItem.HOME::equals) diff --git a/layers/src/main/java/com/iluwatar/layers/service/CakeBakingServiceImpl.java b/layers/src/main/java/com/iluwatar/layers/service/CakeBakingServiceImpl.java index 0626610f8..887a59bf1 100644 --- a/layers/src/main/java/com/iluwatar/layers/service/CakeBakingServiceImpl.java +++ b/layers/src/main/java/com/iluwatar/layers/service/CakeBakingServiceImpl.java @@ -38,7 +38,6 @@ import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; -import java.util.stream.Collectors; import org.springframework.context.support.AbstractApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; import org.springframework.stereotype.Service; @@ -62,7 +61,7 @@ public class CakeBakingServiceImpl implements CakeBakingService { var allToppings = getAvailableToppingEntities(); var matchingToppings = allToppings.stream().filter(t -> t.getName().equals(cakeInfo.cakeToppingInfo.name)) - .collect(Collectors.toList()); + .toList(); if (matchingToppings.isEmpty()) { throw new CakeBakingException(String.format("Topping %s is not available", cakeInfo.cakeToppingInfo.name)); diff --git a/leader-election/src/main/java/com/iluwatar/leaderelection/AbstractMessageManager.java b/leader-election/src/main/java/com/iluwatar/leaderelection/AbstractMessageManager.java index ea7b17242..eab9787d8 100644 --- a/leader-election/src/main/java/com/iluwatar/leaderelection/AbstractMessageManager.java +++ b/leader-election/src/main/java/com/iluwatar/leaderelection/AbstractMessageManager.java @@ -24,9 +24,7 @@ */ package com.iluwatar.leaderelection; -import java.util.List; import java.util.Map; -import java.util.stream.Collectors; /** * Abstract class of all the message manager classes. @@ -56,13 +54,13 @@ public abstract class AbstractMessageManager implements MessageManager { .stream() .filter((i) -> i > currentId && instanceMap.get(i).isAlive()) .sorted() - .collect(Collectors.toList()); + .toList(); if (candidateList.isEmpty()) { var index = instanceMap.keySet() .stream() .filter((i) -> instanceMap.get(i).isAlive()) .sorted() - .collect(Collectors.toList()) + .toList() .get(0); result = instanceMap.get(index); } else { diff --git a/leader-election/src/main/java/com/iluwatar/leaderelection/bully/BullyMessageManager.java b/leader-election/src/main/java/com/iluwatar/leaderelection/bully/BullyMessageManager.java index 2e1fcbce5..6f166dd35 100644 --- a/leader-election/src/main/java/com/iluwatar/leaderelection/bully/BullyMessageManager.java +++ b/leader-election/src/main/java/com/iluwatar/leaderelection/bully/BullyMessageManager.java @@ -30,7 +30,6 @@ import com.iluwatar.leaderelection.Message; import com.iluwatar.leaderelection.MessageType; import java.util.List; import java.util.Map; -import java.util.stream.Collectors; /** * Implementation of BullyMessageManager. @@ -115,7 +114,7 @@ public class BullyMessageManager extends AbstractMessageManager { return instanceMap.keySet() .stream() .filter((i) -> i < currentId && instanceMap.get(i).isAlive()) - .collect(Collectors.toList()); + .toList(); } } diff --git a/leader-election/src/main/java/com/iluwatar/leaderelection/ring/RingInstance.java b/leader-election/src/main/java/com/iluwatar/leaderelection/ring/RingInstance.java index dfacfcab2..d971217a3 100644 --- a/leader-election/src/main/java/com/iluwatar/leaderelection/ring/RingInstance.java +++ b/leader-election/src/main/java/com/iluwatar/leaderelection/ring/RingInstance.java @@ -28,7 +28,6 @@ import com.iluwatar.leaderelection.AbstractInstance; import com.iluwatar.leaderelection.Message; import com.iluwatar.leaderelection.MessageManager; import java.util.Arrays; -import java.util.stream.Collectors; import lombok.extern.slf4j.Slf4j; /** @@ -88,7 +87,7 @@ public class RingInstance extends AbstractInstance { var candidateList = Arrays.stream(content.trim().split(",")) .map(Integer::valueOf) .sorted() - .collect(Collectors.toList()); + .toList(); if (candidateList.contains(localId)) { var newLeaderId = candidateList.get(0); LOGGER.info(INSTANCE + localId + " - New leader should be " + newLeaderId + "."); diff --git a/serialized-entity/pom.xml b/serialized-entity/pom.xml index aea122f5a..754089acf 100644 --- a/serialized-entity/pom.xml +++ b/serialized-entity/pom.xml @@ -1,30 +1,4 @@ - 4.0.0 diff --git a/serialized-entity/src/main/java/com/iluwatar/serializedentity/App.java b/serialized-entity/src/main/java/com/iluwatar/serializedentity/App.java index fb3b383e6..c86102a82 100644 --- a/serialized-entity/src/main/java/com/iluwatar/serializedentity/App.java +++ b/serialized-entity/src/main/java/com/iluwatar/serializedentity/App.java @@ -1,4 +1,6 @@ /* + * This project is licensed under the MIT license. Module model-view-viewmodel is using ZK framework licensed under LGPL (see lgpl-3.0.txt). + * * The MIT License * Copyright © 2014-2022 Ilkka Seppälä * @@ -125,4 +127,4 @@ public class App { dataSource.setURL(DB_URL); return dataSource; } -} +} \ No newline at end of file diff --git a/serialized-entity/src/main/java/com/iluwatar/serializedentity/Country.java b/serialized-entity/src/main/java/com/iluwatar/serializedentity/Country.java index 25ebddf89..e1eb3c22a 100644 --- a/serialized-entity/src/main/java/com/iluwatar/serializedentity/Country.java +++ b/serialized-entity/src/main/java/com/iluwatar/serializedentity/Country.java @@ -1,4 +1,6 @@ /* + * This project is licensed under the MIT license. Module model-view-viewmodel is using ZK framework licensed under LGPL (see lgpl-3.0.txt). + * * The MIT License * Copyright © 2014-2022 Ilkka Seppälä * diff --git a/serialized-entity/src/main/java/com/iluwatar/serializedentity/CountryDao.java b/serialized-entity/src/main/java/com/iluwatar/serializedentity/CountryDao.java index f5d915446..c2bb91c6d 100644 --- a/serialized-entity/src/main/java/com/iluwatar/serializedentity/CountryDao.java +++ b/serialized-entity/src/main/java/com/iluwatar/serializedentity/CountryDao.java @@ -1,4 +1,6 @@ /* + * This project is licensed under the MIT license. Module model-view-viewmodel is using ZK framework licensed under LGPL (see lgpl-3.0.txt). + * * The MIT License * Copyright © 2014-2022 Ilkka Seppälä * diff --git a/serialized-entity/src/main/java/com/iluwatar/serializedentity/CountrySchemaSql.java b/serialized-entity/src/main/java/com/iluwatar/serializedentity/CountrySchemaSql.java index 4887ed9dd..0de83e7e5 100644 --- a/serialized-entity/src/main/java/com/iluwatar/serializedentity/CountrySchemaSql.java +++ b/serialized-entity/src/main/java/com/iluwatar/serializedentity/CountrySchemaSql.java @@ -1,4 +1,6 @@ /* + * This project is licensed under the MIT license. Module model-view-viewmodel is using ZK framework licensed under LGPL (see lgpl-3.0.txt). + * * The MIT License * Copyright © 2014-2022 Ilkka Seppälä * diff --git a/serialized-entity/src/test/java/com/iluwatar/serializedentity/CountryTest.java b/serialized-entity/src/test/java/com/iluwatar/serializedentity/CountryTest.java index 85d3ed87f..556aba173 100644 --- a/serialized-entity/src/test/java/com/iluwatar/serializedentity/CountryTest.java +++ b/serialized-entity/src/test/java/com/iluwatar/serializedentity/CountryTest.java @@ -1,4 +1,6 @@ /* + * This project is licensed under the MIT license. Module model-view-viewmodel is using ZK framework licensed under LGPL (see lgpl-3.0.txt). + * * The MIT License * Copyright © 2014-2022 Ilkka Seppälä * diff --git a/service-to-worker/pom.xml b/service-to-worker/pom.xml index 29f7fe81f..f4f45fd3d 100644 --- a/service-to-worker/pom.xml +++ b/service-to-worker/pom.xml @@ -1,4 +1,30 @@ + diff --git a/service-to-worker/src/test/java/com/iluwatar/servicetoworker/ActionTest.java b/service-to-worker/src/test/java/com/iluwatar/servicetoworker/ActionTest.java index 7c332f522..400010dd0 100644 --- a/service-to-worker/src/test/java/com/iluwatar/servicetoworker/ActionTest.java +++ b/service-to-worker/src/test/java/com/iluwatar/servicetoworker/ActionTest.java @@ -1,3 +1,27 @@ +/* + * This project is licensed under the MIT license. Module model-view-viewmodel is using ZK framework licensed under LGPL (see lgpl-3.0.txt). + * + * The MIT License + * Copyright © 2014-2022 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 + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package com.iluwatar.servicetoworker; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/service-to-worker/src/test/java/com/iluwatar/servicetoworker/AppTest.java b/service-to-worker/src/test/java/com/iluwatar/servicetoworker/AppTest.java index 6611b0ab3..0dce37fca 100644 --- a/service-to-worker/src/test/java/com/iluwatar/servicetoworker/AppTest.java +++ b/service-to-worker/src/test/java/com/iluwatar/servicetoworker/AppTest.java @@ -1,3 +1,27 @@ +/* + * This project is licensed under the MIT license. Module model-view-viewmodel is using ZK framework licensed under LGPL (see lgpl-3.0.txt). + * + * The MIT License + * Copyright © 2014-2022 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 + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package com.iluwatar.servicetoworker; import org.junit.jupiter.api.Test; diff --git a/service-to-worker/src/test/java/com/iluwatar/servicetoworker/DispatcherTest.java b/service-to-worker/src/test/java/com/iluwatar/servicetoworker/DispatcherTest.java index d8f6063db..0551f9b96 100644 --- a/service-to-worker/src/test/java/com/iluwatar/servicetoworker/DispatcherTest.java +++ b/service-to-worker/src/test/java/com/iluwatar/servicetoworker/DispatcherTest.java @@ -1,3 +1,27 @@ +/* + * This project is licensed under the MIT license. Module model-view-viewmodel is using ZK framework licensed under LGPL (see lgpl-3.0.txt). + * + * The MIT License + * Copyright © 2014-2022 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 + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package com.iluwatar.servicetoworker; import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; diff --git a/service-to-worker/src/test/java/com/iluwatar/servicetoworker/GiantControllerTest.java b/service-to-worker/src/test/java/com/iluwatar/servicetoworker/GiantControllerTest.java index e9a982ce9..ce7334b97 100644 --- a/service-to-worker/src/test/java/com/iluwatar/servicetoworker/GiantControllerTest.java +++ b/service-to-worker/src/test/java/com/iluwatar/servicetoworker/GiantControllerTest.java @@ -1,3 +1,27 @@ +/* + * This project is licensed under the MIT license. Module model-view-viewmodel is using ZK framework licensed under LGPL (see lgpl-3.0.txt). + * + * The MIT License + * Copyright © 2014-2022 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 + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package com.iluwatar.servicetoworker; import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; diff --git a/service-to-worker/src/test/java/com/iluwatar/servicetoworker/GiantModelTest.java b/service-to-worker/src/test/java/com/iluwatar/servicetoworker/GiantModelTest.java index d2416701d..b45ba99d4 100644 --- a/service-to-worker/src/test/java/com/iluwatar/servicetoworker/GiantModelTest.java +++ b/service-to-worker/src/test/java/com/iluwatar/servicetoworker/GiantModelTest.java @@ -1,3 +1,27 @@ +/* + * This project is licensed under the MIT license. Module model-view-viewmodel is using ZK framework licensed under LGPL (see lgpl-3.0.txt). + * + * The MIT License + * Copyright © 2014-2022 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 + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package com.iluwatar.servicetoworker; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/service-to-worker/src/test/java/com/iluwatar/servicetoworker/GiantViewTest.java b/service-to-worker/src/test/java/com/iluwatar/servicetoworker/GiantViewTest.java index a33adf619..579f991a9 100644 --- a/service-to-worker/src/test/java/com/iluwatar/servicetoworker/GiantViewTest.java +++ b/service-to-worker/src/test/java/com/iluwatar/servicetoworker/GiantViewTest.java @@ -1,3 +1,27 @@ +/* + * This project is licensed under the MIT license. Module model-view-viewmodel is using ZK framework licensed under LGPL (see lgpl-3.0.txt). + * + * The MIT License + * Copyright © 2014-2022 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 + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package com.iluwatar.servicetoworker; import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; diff --git a/thread-pool/src/test/java/com/iluwatar/threadpool/TaskTest.java b/thread-pool/src/test/java/com/iluwatar/threadpool/TaskTest.java index f33481437..3c3cd950d 100644 --- a/thread-pool/src/test/java/com/iluwatar/threadpool/TaskTest.java +++ b/thread-pool/src/test/java/com/iluwatar/threadpool/TaskTest.java @@ -96,7 +96,7 @@ public abstract class TaskTest { .stream() .map(TaskTest::get) .filter(Objects::nonNull) - .collect(Collectors.toList()); + .toList(); service.shutdownNow();