@@ -8,44 +8,44 @@ public class MaximumSumOfNonAdjacentElementsTest {
8
8
9
9
// Tests for Approach1
10
10
@ Test
11
- public void testGetMaxSumApproach1_WithEmptyArray () {
11
+ public void testGetMaxSumApproach1WithEmptyArray () {
12
12
assertEquals (0 , MaximumSumOfNonAdjacentElements .getMaxSumApproach1 (new int [] {})); // Empty array
13
13
}
14
14
15
15
@ Test
16
- public void testGetMaxSumApproach1_WithSingleElement () {
16
+ public void testGetMaxSumApproach1WithSingleElement () {
17
17
assertEquals (1 , MaximumSumOfNonAdjacentElements .getMaxSumApproach1 (new int [] {1 })); // Single element
18
18
}
19
19
20
20
@ Test
21
- public void testGetMaxSumApproach1_WithTwoElements_TakeMax () {
21
+ public void testGetMaxSumApproach1WithTwoElementsTakeMax () {
22
22
assertEquals (2 , MaximumSumOfNonAdjacentElements .getMaxSumApproach1 (new int [] {1 , 2 })); // Take max of both
23
23
}
24
24
25
25
@ Test
26
- public void testGetMaxSumApproach1_WithMultipleElements () {
26
+ public void testGetMaxSumApproach1WithMultipleElements () {
27
27
assertEquals (15 , MaximumSumOfNonAdjacentElements .getMaxSumApproach1 (new int [] {3 , 2 , 5 , 10 , 7 })); // 3 + 7 + 5
28
28
assertEquals (10 , MaximumSumOfNonAdjacentElements .getMaxSumApproach1 (new int [] {5 , 1 , 1 , 5 })); // 5 + 5
29
29
}
30
30
31
31
// Tests for Approach2
32
32
@ Test
33
- public void testGetMaxSumApproach2_WithEmptyArray () {
33
+ public void testGetMaxSumApproach2WithEmptyArray () {
34
34
assertEquals (0 , MaximumSumOfNonAdjacentElements .getMaxSumApproach2 (new int [] {})); // Empty array
35
35
}
36
36
37
37
@ Test
38
- public void testGetMaxSumApproach2_WithSingleElement () {
38
+ public void testGetMaxSumApproach2WithSingleElement () {
39
39
assertEquals (1 , MaximumSumOfNonAdjacentElements .getMaxSumApproach2 (new int [] {1 })); // Single element
40
40
}
41
41
42
42
@ Test
43
- public void testGetMaxSumApproach2_WithTwoElements_TakeMax () {
43
+ public void testGetMaxSumApproach2WithTwoElementsTakeMax () {
44
44
assertEquals (2 , MaximumSumOfNonAdjacentElements .getMaxSumApproach2 (new int [] {1 , 2 })); // Take max of both
45
45
}
46
46
47
47
@ Test
48
- public void testGetMaxSumApproach2_WithMultipleElements () {
48
+ public void testGetMaxSumApproach2WithMultipleElements () {
49
49
assertEquals (15 , MaximumSumOfNonAdjacentElements .getMaxSumApproach2 (new int [] {3 , 2 , 5 , 10 , 7 })); // 3 + 7 + 5
50
50
assertEquals (10 , MaximumSumOfNonAdjacentElements .getMaxSumApproach2 (new int [] {5 , 1 , 1 , 5 })); // 5 + 5
51
51
}
0 commit comments