@@ -26,7 +26,7 @@ void tearDown() {
26
26
public void testValidInput () {
27
27
// Test with a valid input where pairs satisfy the condition
28
28
List <Integer > skill = Arrays .asList (1 , 2 , 3 , 4 );
29
- long expected = 14 ; // (1 * 4) + (2 * 3) = 14
29
+ long expected = 10 ; // (1 * 4) + (2 * 3) = 10
30
30
assertEquals (expected , app .getTotalEfficiency (skill ));
31
31
}
32
32
@@ -52,7 +52,7 @@ public void testEmptyInput() {
52
52
@ Test
53
53
public void testInvalidPairing () {
54
54
// Test where pairs cannot form the same sum
55
- List <Integer > skill = Arrays .asList (1 , 2 , 5 , 6 );
55
+ List <Integer > skill = Arrays .asList (1 , 2 , 3 , 6 );
56
56
assertEquals (-1 , app .getTotalEfficiency (skill ));
57
57
}
58
58
@@ -68,7 +68,7 @@ public void testAllZeroes() {
68
68
public void testNegativeSkills () {
69
69
// Test with negative skill values
70
70
List <Integer > skill = Arrays .asList (-1 , -2 , -3 , -4 );
71
- long expected = 14 ; // (-4 * -1) + (-3 * -2) = 14
71
+ long expected = 10 ; // (-4 * -1) + (-3 * -2) = 10
72
72
assertEquals (expected , app .getTotalEfficiency (skill ));
73
73
}
74
74
@@ -84,6 +84,7 @@ public void testLargeInput() {
84
84
// Test with a large input size
85
85
List <Integer > skill = Arrays .asList (10 , 20 , 30 , 40 , 50 , 60 , 70 , 80 );
86
86
long expected = 2200 ; // For sorted list, pairing and summing the products satisfies
87
- assertEquals (expected , app .getTotalEfficiency (skill ));
87
+ assertNotEquals (expected , app .getTotalEfficiency (skill ));
88
+ assertEquals (6000 , app .getTotalEfficiency (skill ));
88
89
}
89
90
}
0 commit comments