Skip to content

Commit 527763e

Browse files
committed
fix: * imports
1 parent 2ec74a9 commit 527763e

File tree

2 files changed

+34
-30
lines changed

2 files changed

+34
-30
lines changed
Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,59 @@
11
package com.thealgorithms.stacks;
22

3+
import static org.junit.jupiter.api.Assertions.assertEquals;
4+
import static org.junit.jupiter.api.Assertions.assertThrows;
5+
import static org.junit.jupiter.api.Assertions.assertNull;
6+
37
import org.junit.jupiter.api.BeforeEach;
48
import org.junit.jupiter.api.Test;
59

610
import java.util.NoSuchElementException;
711

8-
import static org.junit.jupiter.api.Assertions.*;
9-
1012
public class GreatestElementConstantTimeTest {
1113

12-
private GreatestElementConstantTime gect;
14+
private GreatestElementConstantTime constantTime;
1315

1416
@BeforeEach
15-
public void setGect() {
16-
gect = new GreatestElementConstantTime();
17+
public void setConstantTime() {
18+
constantTime = new GreatestElementConstantTime();
1719
}
1820

1921
@Test
2022
public void testMaxAtFirst() {
21-
gect.push(1);
22-
gect.push(10);
23-
gect.push(20);
24-
gect.push(5);
25-
assertEquals(20, gect.getMaximumElement());
23+
constantTime.push(1);
24+
constantTime.push(10);
25+
constantTime.push(20);
26+
constantTime.push(5);
27+
assertEquals(20, constantTime.getMaximumElement());
2628
}
2729

2830
@Test
2931
public void testMinTwo() {
30-
gect.push(5);
31-
gect.push(10);
32-
gect.push(20);
33-
gect.push(1);
34-
assertEquals(20, gect.getMaximumElement());
35-
gect.pop();
36-
gect.pop();
37-
assertEquals(10, gect.getMaximumElement());
32+
constantTime.push(5);
33+
constantTime.push(10);
34+
constantTime.push(20);
35+
constantTime.push(1);
36+
assertEquals(20, constantTime.getMaximumElement());
37+
constantTime.pop();
38+
constantTime.pop();
39+
assertEquals(10, constantTime.getMaximumElement());
3840
}
3941

4042
@Test
4143
public void testNullMax() {
42-
gect.push(10);
43-
gect.push(20);
44-
gect.pop();
45-
gect.pop();
46-
assertNull(gect.getMaximumElement());
44+
constantTime.push(10);
45+
constantTime.push(20);
46+
constantTime.pop();
47+
constantTime.pop();
48+
assertNull(constantTime.getMaximumElement());
4749
}
4850

4951
@Test
5052
public void testBlankHandle() {
51-
gect.push(10);
52-
gect.push(1);
53-
gect.pop();
54-
gect.pop();
55-
assertThrows(NoSuchElementException.class, () -> gect.pop());
53+
constantTime.push(10);
54+
constantTime.push(1);
55+
constantTime.pop();
56+
constantTime.pop();
57+
assertThrows(NoSuchElementException.class, () -> constantTime.pop());
5658
}
5759
}

src/test/java/com/thealgorithms/stacks/SmallestElementConstantTimeTest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
package com.thealgorithms.stacks;
22

3+
import static org.junit.jupiter.api.Assertions.assertEquals;
4+
import static org.junit.jupiter.api.Assertions.assertThrows;
5+
import static org.junit.jupiter.api.Assertions.assertNull;
6+
37
import org.junit.jupiter.api.BeforeEach;
48
import org.junit.jupiter.api.Test;
59

610
import java.util.NoSuchElementException;
711

8-
import static org.junit.jupiter.api.Assertions.*;
9-
1012
public class SmallestElementConstantTimeTest {
1113

1214
private SmallestElementConstantTime sect;

0 commit comments

Comments
 (0)