1515 * @author Donato Rimenti
1616 *
1717 */
18- public class SingletonSynchronizationUnitTest {
18+ public class SingletonSynchronizationIntegrationTest {
1919
2020 /**
2121 * Size of the thread pools used.
@@ -33,7 +33,7 @@ public class SingletonSynchronizationUnitTest {
3333 @ Test
3434 public void givenDraconianSingleton_whenMultithreadInstancesEquals_thenTrue () {
3535 ExecutorService executor = Executors .newFixedThreadPool (POOL_SIZE );
36- Set <DraconianSingleton > resultSet = Collections .synchronizedSet (new HashSet <DraconianSingleton >());
36+ Set <DraconianSingleton > resultSet = Collections .synchronizedSet (new HashSet <>());
3737
3838 // Submits the instantiation tasks.
3939 for (int i = 0 ; i < TASKS_TO_SUBMIT ; i ++) {
@@ -51,7 +51,7 @@ public void givenDraconianSingleton_whenMultithreadInstancesEquals_thenTrue() {
5151 @ Test
5252 public void givenDclSingleton_whenMultithreadInstancesEquals_thenTrue () {
5353 ExecutorService executor = Executors .newFixedThreadPool (POOL_SIZE );
54- Set <DclSingleton > resultSet = Collections .synchronizedSet (new HashSet <DclSingleton >());
54+ Set <DclSingleton > resultSet = Collections .synchronizedSet (new HashSet <>());
5555
5656 // Submits the instantiation tasks.
5757 for (int i = 0 ; i < TASKS_TO_SUBMIT ; i ++) {
@@ -69,7 +69,7 @@ public void givenDclSingleton_whenMultithreadInstancesEquals_thenTrue() {
6969 @ Test
7070 public void givenEarlyInitSingleton_whenMultithreadInstancesEquals_thenTrue () {
7171 ExecutorService executor = Executors .newFixedThreadPool (POOL_SIZE );
72- Set <EarlyInitSingleton > resultSet = Collections .synchronizedSet (new HashSet <EarlyInitSingleton >());
72+ Set <EarlyInitSingleton > resultSet = Collections .synchronizedSet (new HashSet <>());
7373
7474 // Submits the instantiation tasks.
7575 for (int i = 0 ; i < TASKS_TO_SUBMIT ; i ++) {
@@ -87,7 +87,7 @@ public void givenEarlyInitSingleton_whenMultithreadInstancesEquals_thenTrue() {
8787 @ Test
8888 public void givenInitOnDemandSingleton_whenMultithreadInstancesEquals_thenTrue () {
8989 ExecutorService executor = Executors .newFixedThreadPool (POOL_SIZE );
90- Set <InitOnDemandSingleton > resultSet = Collections .synchronizedSet (new HashSet <InitOnDemandSingleton >());
90+ Set <InitOnDemandSingleton > resultSet = Collections .synchronizedSet (new HashSet <>());
9191
9292 // Submits the instantiation tasks.
9393 for (int i = 0 ; i < TASKS_TO_SUBMIT ; i ++) {
@@ -105,7 +105,7 @@ public void givenInitOnDemandSingleton_whenMultithreadInstancesEquals_thenTrue()
105105 @ Test
106106 public void givenEnumSingleton_whenMultithreadInstancesEquals_thenTrue () {
107107 ExecutorService executor = Executors .newFixedThreadPool (POOL_SIZE );
108- Set <EnumSingleton > resultSet = Collections .synchronizedSet (new HashSet <EnumSingleton >());
108+ Set <EnumSingleton > resultSet = Collections .synchronizedSet (new HashSet <>());
109109
110110 // Submits the instantiation tasks.
111111 for (int i = 0 ; i < TASKS_TO_SUBMIT ; i ++) {
0 commit comments