11package com .thealgorithms .maths ;
22
33import static org .junit .jupiter .api .Assertions .assertEquals ;
4- import java . util . List ;
4+
55import java .util .Arrays ;
6+ import java .util .List ;
67import org .junit .jupiter .api .Test ;
78
89public class ChineseRemainderTheoremTest {
@@ -19,7 +20,7 @@ public void testCRTSimpleCase() {
1920 public void testCRTLargeModuli () {
2021 List <Integer > remainders = Arrays .asList (1 , 2 , 3 );
2122 List <Integer > moduli = Arrays .asList (5 , 7 , 9 );
22- int expected = 131 ;
23+ int expected = 156 ;
2324 int result = ChineseRemainderTheorem .solveCRT (remainders , moduli );
2425 assertEquals (expected , result );
2526 }
@@ -37,7 +38,7 @@ public void testCRTWithSingleCongruence() {
3738 public void testCRTWithMultipleSolutions () {
3839 List <Integer > remainders = Arrays .asList (0 , 3 );
3940 List <Integer > moduli = Arrays .asList (4 , 5 );
40- int expected = 15 ;
41+ int expected = 8 ;
4142 int result = ChineseRemainderTheorem .solveCRT (remainders , moduli );
4243 assertEquals (expected , result );
4344 }
@@ -46,7 +47,7 @@ public void testCRTWithMultipleSolutions() {
4647 public void testCRTLargeNumbers () {
4748 List <Integer > remainders = Arrays .asList (0 , 4 , 6 );
4849 List <Integer > moduli = Arrays .asList (11 , 13 , 17 );
49- int expected = 782 ;
50+ int expected = 550 ;
5051 int result = ChineseRemainderTheorem .solveCRT (remainders , moduli );
5152 assertEquals (expected , result );
5253 }
0 commit comments