Skip to content

Commit 2a9554a

Browse files
author
pushkar
committed
Resolved the checkstyle violations in the testcase classes
1 parent 853d2e4 commit 2a9554a

File tree

6 files changed

+18
-7
lines changed

6 files changed

+18
-7
lines changed

src/test/java/com/thealgorithms/sorts/AdaptiveMergeSortTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,9 @@ public int compareTo(Person o) {
107107

108108
@Override
109109
public boolean equals(Object o) {
110-
if (!(o instanceof Person)) return false;
110+
if (!(o instanceof Person)) {
111+
return false;
112+
}
111113
Person p = (Person) o;
112114
return this.name.equals(p.name) && this.age == p.age;
113115
}

src/test/java/com/thealgorithms/sorts/BogoSortTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,9 @@ public int compareTo(Person o) {
116116

117117
@Override
118118
public boolean equals(Object o) {
119-
if (!(o instanceof Person)) return false;
119+
if (!(o instanceof Person)) {
120+
return false;
121+
}
120122
Person p = (Person) o;
121123
return this.name.equals(p.name) && this.age == p.age;
122124
}

src/test/java/com/thealgorithms/sorts/BubbleSortTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,9 @@ public int compareTo(Person o) {
144144

145145
@Override
146146
public boolean equals(Object o) {
147-
if (!(o instanceof Person)) return false;
147+
if (!(o instanceof Person)) {
148+
return false;
149+
}
148150
Person p = (Person) o;
149151
return this.name.equals(p.name) && this.age == p.age;
150152
}

src/test/java/com/thealgorithms/sorts/GnomeSortTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,9 @@ public int compareTo(Person o) {
137137

138138
@Override
139139
public boolean equals(Object o) {
140-
if (!(o instanceof Person)) return false;
140+
if (!(o instanceof Person)) {
141+
return false;
142+
}
141143
Person p = (Person) o;
142144
return this.name.equals(p.name) && this.age == p.age;
143145
}

src/test/java/com/thealgorithms/sorts/InsertionSortTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import java.util.Objects;
77
import java.util.function.Function;
88
import org.junit.jupiter.api.BeforeEach;
9-
import org.junit.jupiter.api.DisplayName;
109
import org.junit.jupiter.api.Test;
1110

1211
class InsertionSortTest {
@@ -165,7 +164,9 @@ public int compareTo(Person o) {
165164

166165
@Override
167166
public boolean equals(Object o) {
168-
if (!(o instanceof Person)) return false;
167+
if (!(o instanceof Person)) {
168+
return false;
169+
}
169170
Person p = (Person) o;
170171
return this.name.equals(p.name) && this.age == p.age;
171172
}

src/test/java/com/thealgorithms/sorts/SlowSortTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,9 @@ public int compareTo(Person o) {
129129

130130
@Override
131131
public boolean equals(Object o) {
132-
if (!(o instanceof Person)) return false;
132+
if (!(o instanceof Person)) {
133+
return false;
134+
}
133135
Person p = (Person) o;
134136
return this.name.equals(p.name) && this.age == p.age;
135137
}

0 commit comments

Comments
 (0)