diff --git a/singleton/src/main/java/com/iluwatar/singleton/App.java b/singleton/src/main/java/com/iluwatar/singleton/App.java
index b085bc8af..604b81184 100644
--- a/singleton/src/main/java/com/iluwatar/singleton/App.java
+++ b/singleton/src/main/java/com/iluwatar/singleton/App.java
@@ -27,40 +27,40 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
- * Singleton pattern ensures that the class can have only one existing instance per Java classloader
- * instance and provides global access to it.
- *
- * One of the risks of this pattern is that bugs resulting from setting a singleton up in a
+ *
Singleton pattern ensures that the class can have only one existing instance per Java
+ * classloader instance and provides global access to it.
+ *
+ *
One of the risks of this pattern is that bugs resulting from setting a singleton up in a
* distributed environment can be tricky to debug, since it will work fine if you debug with a
* single classloader. Additionally, these problems can crop up a while after the implementation of
* a singleton, since they may start out synchronous and only become async with time, so you it may
- * not be clear why you are seeing certain changes in behaviour.
- *
- * There are many ways to implement the Singleton. The first one is the eagerly initialized instance
- * in {@link IvoryTower}. Eager initialization implies that the implementation is thread safe. If
- * you can afford giving up control of the instantiation moment, then this implementation will suit
- * you fine.
- *
- * The other option to implement eagerly initialized Singleton is enum based Singleton. The example
- * is found in {@link EnumIvoryTower}. At first glance the code looks short and simple. However, you
- * should be aware of the downsides including committing to implementation strategy, extending the
- * enum class, serializability and restrictions to coding. These are extensively discussed in Stack
- * Overflow:
+ * not be clear why you are seeing certain changes in behaviour.
+ *
+ *
There are many ways to implement the Singleton. The first one is the eagerly initialized
+ * instance in {@link IvoryTower}. Eager initialization implies that the implementation is thread
+ * safe. If you can afford giving up control of the instantiation moment, then this implementation
+ * will suit you fine.
+ *
+ *
The other option to implement eagerly initialized Singleton is enum based Singleton. The
+ * example is found in {@link EnumIvoryTower}. At first glance the code looks short and simple.
+ * However, you should be aware of the downsides including committing to implementation strategy,
+ * extending the enum class, serializability and restrictions to coding. These are extensively
+ * discussed in Stack Overflow:
* http://programmers.stackexchange.com/questions/179386/what-are-the-downsides-of-implementing
- * -a-singleton-with-javas-enum
- *
- * {@link ThreadSafeLazyLoadedIvoryTower} is a Singleton implementation that is initialized on
+ * -a-singleton-with-javas-enum
+ *
+ *
{@link ThreadSafeLazyLoadedIvoryTower} is a Singleton implementation that is initialized on
* demand. The downside is that it is very slow to access since the whole access method is
- * synchronized.
- *
- * Another Singleton implementation that is initialized on demand is found in
+ * synchronized.
+ *
+ *
Another Singleton implementation that is initialized on demand is found in
* {@link ThreadSafeDoubleCheckLocking}. It is somewhat faster than
* {@link ThreadSafeLazyLoadedIvoryTower} since it doesn't synchronize the whole access method but
- * only the method internals on specific conditions.
- *
- * Yet another way to implement thread safe lazily initialized Singleton can be found in
+ * only the method internals on specific conditions.
+ *
+ *
Yet another way to implement thread safe lazily initialized Singleton can be found in
* {@link InitializingOnDemandHolderIdiom}. However, this implementation requires at least Java 8
- * API level to work.
+ * API level to work.
*/
public class App {
diff --git a/singleton/src/main/java/com/iluwatar/singleton/EnumIvoryTower.java b/singleton/src/main/java/com/iluwatar/singleton/EnumIvoryTower.java
index 2028b7d76..753201dba 100644
--- a/singleton/src/main/java/com/iluwatar/singleton/EnumIvoryTower.java
+++ b/singleton/src/main/java/com/iluwatar/singleton/EnumIvoryTower.java
@@ -24,10 +24,10 @@
package com.iluwatar.singleton;
/**
- * Enum based singleton implementation. Effective Java 2nd Edition (Joshua Bloch) p. 18
+ *
Enum based singleton implementation. Effective Java 2nd Edition (Joshua Bloch) p. 18
*
- * This implementation is thread safe, however adding any other method and its thread safety
- * is developers responsibility.
+ *
This implementation is thread safe, however adding any other method and its thread safety
+ * is developers responsibility.
*/
public enum EnumIvoryTower {
diff --git a/singleton/src/main/java/com/iluwatar/singleton/InitializingOnDemandHolderIdiom.java b/singleton/src/main/java/com/iluwatar/singleton/InitializingOnDemandHolderIdiom.java
index dfd4951f7..faf53a63e 100644
--- a/singleton/src/main/java/com/iluwatar/singleton/InitializingOnDemandHolderIdiom.java
+++ b/singleton/src/main/java/com/iluwatar/singleton/InitializingOnDemandHolderIdiom.java
@@ -24,16 +24,16 @@
package com.iluwatar.singleton;
/**
- * The Initialize-on-demand-holder idiom is a secure way of creating a lazy initialized singleton
- * object in Java.
- *
- * The technique is as lazy as possible and works in all known versions of Java. It takes advantage
- * of language guarantees about class initialization, and will therefore work correctly in all
- * Java-compliant compilers and virtual machines.
- *
- * The inner class is referenced no earlier (and therefore loaded no earlier by the class loader) than
- * the moment that getInstance() is called. Thus, this solution is thread-safe without requiring special
- * language constructs (i.e. volatile or synchronized).
+ *
The Initialize-on-demand-holder idiom is a secure way of creating a lazy initialized singleton
+ * object in Java.
+ *
+ *
The technique is as lazy as possible and works in all known versions of Java. It takes
+ * advantage of language guarantees about class initialization, and will therefore work correctly
+ * in all Java-compliant compilers and virtual machines.
+ *
+ *
The inner class is referenced no earlier (and therefore loaded no earlier by the class loader)
+ * than the moment that getInstance() is called. Thus, this solution is thread-safe without
+ * requiring special language constructs (i.e. volatile or synchronized).
*
*/
public final class InitializingOnDemandHolderIdiom {
@@ -44,6 +44,8 @@ public final class InitializingOnDemandHolderIdiom {
private InitializingOnDemandHolderIdiom() {}
/**
+ * Sigleton instance.
+ *
* @return Singleton instance
*/
public static InitializingOnDemandHolderIdiom getInstance() {
diff --git a/singleton/src/main/java/com/iluwatar/singleton/ThreadSafeDoubleCheckLocking.java b/singleton/src/main/java/com/iluwatar/singleton/ThreadSafeDoubleCheckLocking.java
index a1ae935a3..f5d47380f 100644
--- a/singleton/src/main/java/com/iluwatar/singleton/ThreadSafeDoubleCheckLocking.java
+++ b/singleton/src/main/java/com/iluwatar/singleton/ThreadSafeDoubleCheckLocking.java
@@ -24,11 +24,11 @@
package com.iluwatar.singleton;
/**
- * Double check locking
- *
*
* @author mortezaadi@gmail.com
*/
@@ -60,17 +60,21 @@ public final class ThreadSafeDoubleCheckLocking {
// Joshua Bloch "Effective Java, Second Edition", p. 283-284
var result = instance;
- // Check if singleton instance is initialized. If it is initialized then we can return the instance.
+ // Check if singleton instance is initialized.
+ // If it is initialized then we can return the instance.
if (result == null) {
- // It is not initialized but we cannot be sure because some other thread might have initialized it
- // in the meanwhile. So to make sure we need to lock on an object to get mutual exclusion.
+ // It is not initialized but we cannot be sure because some other thread might have
+ // initialized it in the meanwhile.
+ // So to make sure we need to lock on an object to get mutual exclusion.
synchronized (ThreadSafeDoubleCheckLocking.class) {
- // Again assign the instance to local variable to check if it was initialized by some other thread
- // while current thread was blocked to enter the locked zone. If it was initialized then we can
- // return the previously created instance just like the previous null check.
+ // Again assign the instance to local variable to check if it was initialized by some
+ // other thread while current thread was blocked to enter the locked zone.
+ // If it was initialized then we can return the previously created instance
+ // just like the previous null check.
result = instance;
if (result == null) {
- // The instance is still not initialized so we can safely (no other thread can enter this zone)
+ // The instance is still not initialized so we can safely
+ // (no other thread can enter this zone)
// create an instance and make it our singleton instance.
instance = result = new ThreadSafeDoubleCheckLocking();
}
diff --git a/singleton/src/main/java/com/iluwatar/singleton/ThreadSafeLazyLoadedIvoryTower.java b/singleton/src/main/java/com/iluwatar/singleton/ThreadSafeLazyLoadedIvoryTower.java
index 82580acf6..dd6d05fea 100644
--- a/singleton/src/main/java/com/iluwatar/singleton/ThreadSafeLazyLoadedIvoryTower.java
+++ b/singleton/src/main/java/com/iluwatar/singleton/ThreadSafeLazyLoadedIvoryTower.java
@@ -24,11 +24,11 @@
package com.iluwatar.singleton;
/**
- * Thread-safe Singleton class. The instance is lazily initialized and thus needs synchronization
- * mechanism.
+ *
Thread-safe Singleton class. The instance is lazily initialized and thus needs synchronization
+ * mechanism.
*
- * Note: if created by reflection then a singleton will not be created but multiple options in the
- * same classloader
+ *
Note: if created by reflection then a singleton will not be created but multiple options
+ * in the same classloader
*/
public final class ThreadSafeLazyLoadedIvoryTower {
diff --git a/singleton/src/test/java/com/iluwatar/singleton/AppTest.java b/singleton/src/test/java/com/iluwatar/singleton/AppTest.java
index 66974e472..75043eae0 100644
--- a/singleton/src/test/java/com/iluwatar/singleton/AppTest.java
+++ b/singleton/src/test/java/com/iluwatar/singleton/AppTest.java
@@ -26,9 +26,7 @@ package com.iluwatar.singleton;
import org.junit.jupiter.api.Test;
/**
- *
- * Application test
- *
+ * Application test.
*/
public class AppTest {
diff --git a/singleton/src/test/java/com/iluwatar/singleton/EnumIvoryTowerTest.java b/singleton/src/test/java/com/iluwatar/singleton/EnumIvoryTowerTest.java
index 49dfae6b0..6a19ca752 100644
--- a/singleton/src/test/java/com/iluwatar/singleton/EnumIvoryTowerTest.java
+++ b/singleton/src/test/java/com/iluwatar/singleton/EnumIvoryTowerTest.java
@@ -24,14 +24,14 @@
package com.iluwatar.singleton;
/**
- * Date: 12/29/15 - 19:20 PM
+ * Date: 12/29/15 - 19:20 PM.
*
* @author Jeroen Meulemeester
*/
public class EnumIvoryTowerTest extends SingletonTest {
/**
- * Create a new singleton test instance using the given 'getInstance' method
+ * Create a new singleton test instance using the given 'getInstance' method.
*/
public EnumIvoryTowerTest() {
super(() -> EnumIvoryTower.INSTANCE);
diff --git a/singleton/src/test/java/com/iluwatar/singleton/InitializingOnDemandHolderIdiomTest.java b/singleton/src/test/java/com/iluwatar/singleton/InitializingOnDemandHolderIdiomTest.java
index d7021dac7..e85555012 100644
--- a/singleton/src/test/java/com/iluwatar/singleton/InitializingOnDemandHolderIdiomTest.java
+++ b/singleton/src/test/java/com/iluwatar/singleton/InitializingOnDemandHolderIdiomTest.java
@@ -24,14 +24,15 @@
package com.iluwatar.singleton;
/**
- * Date: 12/29/15 - 19:22 PM
+ * Date: 12/29/15 - 19:22 PM.
*
* @author Jeroen Meulemeester
*/
-public class InitializingOnDemandHolderIdiomTest extends SingletonTest {
+public class InitializingOnDemandHolderIdiomTest
+ extends SingletonTest {
/**
- * Create a new singleton test instance using the given 'getInstance' method
+ * Create a new singleton test instance using the given 'getInstance' method.
*/
public InitializingOnDemandHolderIdiomTest() {
super(InitializingOnDemandHolderIdiom::getInstance);
diff --git a/singleton/src/test/java/com/iluwatar/singleton/IvoryTowerTest.java b/singleton/src/test/java/com/iluwatar/singleton/IvoryTowerTest.java
index ac5a145cb..de4dc3a18 100644
--- a/singleton/src/test/java/com/iluwatar/singleton/IvoryTowerTest.java
+++ b/singleton/src/test/java/com/iluwatar/singleton/IvoryTowerTest.java
@@ -24,14 +24,14 @@
package com.iluwatar.singleton;
/**
- * Date: 12/29/15 - 19:23 PM
+ * Date: 12/29/15 - 19:23 PM.
*
* @author Jeroen Meulemeester
*/
public class IvoryTowerTest extends SingletonTest {
/**
- * Create a new singleton test instance using the given 'getInstance' method
+ * Create a new singleton test instance using the given 'getInstance' method.
*/
public IvoryTowerTest() {
super(IvoryTower::getInstance);
diff --git a/singleton/src/test/java/com/iluwatar/singleton/SingletonTest.java b/singleton/src/test/java/com/iluwatar/singleton/SingletonTest.java
index e98796aef..4dc1ecdff 100644
--- a/singleton/src/test/java/com/iluwatar/singleton/SingletonTest.java
+++ b/singleton/src/test/java/com/iluwatar/singleton/SingletonTest.java
@@ -23,8 +23,10 @@
package com.iluwatar.singleton;
-import org.junit.jupiter.api.Disabled;
-import org.junit.jupiter.api.Test;
+import static java.time.Duration.ofMillis;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertSame;
+import static org.junit.jupiter.api.Assertions.assertTimeout;
import java.util.ArrayList;
import java.util.List;
@@ -34,19 +36,17 @@ import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.function.Supplier;
-import static java.time.Duration.ofMillis;
-import static org.junit.jupiter.api.Assertions.assertNotNull;
-import static org.junit.jupiter.api.Assertions.assertSame;
-import static org.junit.jupiter.api.Assertions.assertTimeout;
+import org.junit.jupiter.api.Test;
/**
- * This class provides several test case that test singleton construction.
+ *
This class provides several test case that test singleton construction.
*
- * The first proves that multiple calls to the singleton getInstance object are the same when called
- * in the SAME thread. The second proves that multiple calls to the singleton getInstance object are
- * the same when called in the DIFFERENT thread.
+ *
The first proves that multiple calls to the singleton getInstance object are the same when
+ * called in the SAME thread. The second proves that multiple calls to the singleton getInstance
+ * object are the same when called in the DIFFERENT thread.
+ *
+ *
Date: 12/29/15 - 19:25 PM
*
- * Date: 12/29/15 - 19:25 PM
* @param Supplier method generating singletons
* @author Jeroen Meulemeester
* @author Richard Jones
@@ -54,12 +54,12 @@ import static org.junit.jupiter.api.Assertions.assertTimeout;
public abstract class SingletonTest {
/**
- * The singleton's getInstance method
+ * The singleton's getInstance method.
*/
private final Supplier singletonInstanceMethod;
/**
- * Create a new singleton test instance using the given 'getInstance' method
+ * Create a new singleton test instance using the given 'getInstance' method.
*
* @param singletonInstanceMethod The singleton's getInstance method
*/
@@ -68,7 +68,7 @@ public abstract class SingletonTest {
}
/**
- * Test the singleton in a non-concurrent setting
+ * Test the singleton in a non-concurrent setting.
*/
@Test
public void testMultipleCallsReturnTheSameObjectInSameThread() {
@@ -83,7 +83,7 @@ public abstract class SingletonTest {
}
/**
- * Test singleton instance in a concurrent setting
+ * Test singleton instance in a concurrent setting.
*/
@Test
public void testMultipleCallsReturnTheSameObjectInDifferentThreads() throws Exception {
diff --git a/singleton/src/test/java/com/iluwatar/singleton/ThreadSafeDoubleCheckLockingTest.java b/singleton/src/test/java/com/iluwatar/singleton/ThreadSafeDoubleCheckLockingTest.java
index fff516ad3..8babb081e 100644
--- a/singleton/src/test/java/com/iluwatar/singleton/ThreadSafeDoubleCheckLockingTest.java
+++ b/singleton/src/test/java/com/iluwatar/singleton/ThreadSafeDoubleCheckLockingTest.java
@@ -23,34 +23,35 @@
package com.iluwatar.singleton;
-import org.junit.Test;
-
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
+import org.junit.Test;
+
/**
- * Date: 12/29/15 - 19:26 PM
+ * Date: 12/29/15 - 19:26 PM.
*
* @author Jeroen Meulemeester
*/
public class ThreadSafeDoubleCheckLockingTest extends SingletonTest {
/**
- * Create a new singleton test instance using the given 'getInstance' method
+ * Create a new singleton test instance using the given 'getInstance' method.
*/
public ThreadSafeDoubleCheckLockingTest() {
super(ThreadSafeDoubleCheckLocking::getInstance);
}
/**
- * Test creating new instance by refection
+ * Test creating new instance by refection.
*/
@Test(expected = InvocationTargetException.class)
public void testCreatingNewInstanceByRefection() throws Exception {
ThreadSafeDoubleCheckLocking instance1 = ThreadSafeDoubleCheckLocking.getInstance();
Constructor constructor = ThreadSafeDoubleCheckLocking.class.getDeclaredConstructor();
constructor.setAccessible(true);
- ThreadSafeDoubleCheckLocking instance2 = (ThreadSafeDoubleCheckLocking) constructor.newInstance(null);
+ ThreadSafeDoubleCheckLocking instance2 =
+ (ThreadSafeDoubleCheckLocking) constructor.newInstance(null);
}
}
\ No newline at end of file
diff --git a/singleton/src/test/java/com/iluwatar/singleton/ThreadSafeLazyLoadedIvoryTowerTest.java b/singleton/src/test/java/com/iluwatar/singleton/ThreadSafeLazyLoadedIvoryTowerTest.java
index 7ca1caf3d..da04722fc 100644
--- a/singleton/src/test/java/com/iluwatar/singleton/ThreadSafeLazyLoadedIvoryTowerTest.java
+++ b/singleton/src/test/java/com/iluwatar/singleton/ThreadSafeLazyLoadedIvoryTowerTest.java
@@ -24,14 +24,15 @@
package com.iluwatar.singleton;
/**
- * Date: 12/29/15 - 19:26 PM
+ * Date: 12/29/15 - 19:26 PM.
*
* @author Jeroen Meulemeester
*/
-public class ThreadSafeLazyLoadedIvoryTowerTest extends SingletonTest {
+public class ThreadSafeLazyLoadedIvoryTowerTest
+ extends SingletonTest {
/**
- * Create a new singleton test instance using the given 'getInstance' method
+ * Create a new singleton test instance using the given 'getInstance' method.
*/
public ThreadSafeLazyLoadedIvoryTowerTest() {
super(ThreadSafeLazyLoadedIvoryTower::getInstance);
diff --git a/strategy/src/main/java/com/iluwatar/strategy/App.java b/strategy/src/main/java/com/iluwatar/strategy/App.java
index c6bd3aa3b..c526c7917 100644
--- a/strategy/src/main/java/com/iluwatar/strategy/App.java
+++ b/strategy/src/main/java/com/iluwatar/strategy/App.java
@@ -28,15 +28,15 @@ import org.slf4j.LoggerFactory;
/**
*
- * The Strategy pattern (also known as the policy pattern) is a software design pattern that enables
- * an algorithm's behavior to be selected at runtime.
- *
- * Before Java 8 the Strategies needed to be separate classes forcing the developer
+ *
The Strategy pattern (also known as the policy pattern) is a software design pattern that
+ * enables an algorithm's behavior to be selected at runtime.
+ *
+ *
Before Java 8 the Strategies needed to be separate classes forcing the developer
* to write lots of boilerplate code. With modern Java it is easy to pass behavior
- * with method references and lambdas making the code shorter and more readable.
- *
- * In this example ({@link DragonSlayingStrategy}) encapsulates an algorithm. The containing object
- * ({@link DragonSlayer}) can alter its behavior by changing its strategy.
+ * with method references and lambdas making the code shorter and more readable.
+ *
+ *
In this example ({@link DragonSlayingStrategy}) encapsulates an algorithm. The containing
+ * object ({@link DragonSlayer}) can alter its behavior by changing its strategy.
*
*/
public class App {
@@ -44,7 +44,7 @@ public class App {
private static final Logger LOGGER = LoggerFactory.getLogger(App.class);
/**
- * Program entry point
+ * Program entry point.
*
* @param args command line args
*/
diff --git a/strategy/src/main/java/com/iluwatar/strategy/DragonSlayer.java b/strategy/src/main/java/com/iluwatar/strategy/DragonSlayer.java
index 0455edaca..f6b91d967 100644
--- a/strategy/src/main/java/com/iluwatar/strategy/DragonSlayer.java
+++ b/strategy/src/main/java/com/iluwatar/strategy/DragonSlayer.java
@@ -24,9 +24,7 @@
package com.iluwatar.strategy;
/**
- *
* DragonSlayer uses different strategies to slay the dragon.
- *
*/
public class DragonSlayer {
diff --git a/strategy/src/main/java/com/iluwatar/strategy/DragonSlayingStrategy.java b/strategy/src/main/java/com/iluwatar/strategy/DragonSlayingStrategy.java
index eb89523ad..537b521f4 100644
--- a/strategy/src/main/java/com/iluwatar/strategy/DragonSlayingStrategy.java
+++ b/strategy/src/main/java/com/iluwatar/strategy/DragonSlayingStrategy.java
@@ -24,9 +24,7 @@
package com.iluwatar.strategy;
/**
- *
* Strategy interface.
- *
*/
@FunctionalInterface
public interface DragonSlayingStrategy {
diff --git a/strategy/src/main/java/com/iluwatar/strategy/MeleeStrategy.java b/strategy/src/main/java/com/iluwatar/strategy/MeleeStrategy.java
index 8cb2f24c1..12f467b07 100644
--- a/strategy/src/main/java/com/iluwatar/strategy/MeleeStrategy.java
+++ b/strategy/src/main/java/com/iluwatar/strategy/MeleeStrategy.java
@@ -27,9 +27,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
- *
* Melee strategy.
- *
*/
public class MeleeStrategy implements DragonSlayingStrategy {
diff --git a/strategy/src/main/java/com/iluwatar/strategy/ProjectileStrategy.java b/strategy/src/main/java/com/iluwatar/strategy/ProjectileStrategy.java
index 4b6031ddf..769b0d7d9 100644
--- a/strategy/src/main/java/com/iluwatar/strategy/ProjectileStrategy.java
+++ b/strategy/src/main/java/com/iluwatar/strategy/ProjectileStrategy.java
@@ -27,9 +27,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
- *
* Projectile strategy.
- *
*/
public class ProjectileStrategy implements DragonSlayingStrategy {
diff --git a/strategy/src/main/java/com/iluwatar/strategy/SpellStrategy.java b/strategy/src/main/java/com/iluwatar/strategy/SpellStrategy.java
index ffe85c7a2..dfa47f72b 100644
--- a/strategy/src/main/java/com/iluwatar/strategy/SpellStrategy.java
+++ b/strategy/src/main/java/com/iluwatar/strategy/SpellStrategy.java
@@ -27,9 +27,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
- *
* Spell strategy.
- *
*/
public class SpellStrategy implements DragonSlayingStrategy {
diff --git a/strategy/src/test/java/com/iluwatar/strategy/AppTest.java b/strategy/src/test/java/com/iluwatar/strategy/AppTest.java
index 598085ce4..713eecf43 100644
--- a/strategy/src/test/java/com/iluwatar/strategy/AppTest.java
+++ b/strategy/src/test/java/com/iluwatar/strategy/AppTest.java
@@ -26,9 +26,7 @@ package com.iluwatar.strategy;
import org.junit.jupiter.api.Test;
/**
- *
- * Application test
- *
+ * Application test.
*/
public class AppTest {
diff --git a/strategy/src/test/java/com/iluwatar/strategy/DragonSlayerTest.java b/strategy/src/test/java/com/iluwatar/strategy/DragonSlayerTest.java
index 52dfb3ff1..c95612683 100644
--- a/strategy/src/test/java/com/iluwatar/strategy/DragonSlayerTest.java
+++ b/strategy/src/test/java/com/iluwatar/strategy/DragonSlayerTest.java
@@ -23,21 +23,21 @@
package com.iluwatar.strategy;
-import org.junit.jupiter.api.Test;
-
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;
+import org.junit.jupiter.api.Test;
+
/**
- * Date: 12/29/15 - 10:50 PM
+ * Date: 12/29/15 - 10:50 PM.
*
* @author Jeroen Meulemeester
*/
public class DragonSlayerTest {
/**
- * Verify if the dragon slayer uses the strategy during battle
+ * Verify if the dragon slayer uses the strategy during battle.
*/
@Test
public void testGoToBattle() {
@@ -50,7 +50,7 @@ public class DragonSlayerTest {
}
/**
- * Verify if the dragon slayer uses the new strategy during battle after a change of strategy
+ * Verify if the dragon slayer uses the new strategy during battle after a change of strategy.
*/
@Test
public void testChangeStrategy() {
diff --git a/strategy/src/test/java/com/iluwatar/strategy/DragonSlayingStrategyTest.java b/strategy/src/test/java/com/iluwatar/strategy/DragonSlayingStrategyTest.java
index 67e4b92cc..15106cdd9 100644
--- a/strategy/src/test/java/com/iluwatar/strategy/DragonSlayingStrategyTest.java
+++ b/strategy/src/test/java/com/iluwatar/strategy/DragonSlayingStrategyTest.java
@@ -23,45 +23,48 @@
package com.iluwatar.strategy;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
import ch.qos.logback.classic.Logger;
import ch.qos.logback.classic.spi.ILoggingEvent;
import ch.qos.logback.core.AppenderBase;
+
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource;
import org.slf4j.LoggerFactory;
-import java.util.Collection;
-import java.util.LinkedList;
-import java.util.List;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-
/**
- * Date: 12/29/15 - 10:58 PM
+ * Date: 12/29/15 - 10:58 PM.
*
* @author Jeroen Meulemeester
*/
public class DragonSlayingStrategyTest {
/**
+ * Assembles test parameters.
+ *
* @return The test parameters for each cycle
*/
static Collection