4
4
import java .math .BigDecimal ;
5
5
import java .util .ArrayDeque ;
6
6
import java .util .ArrayList ;
7
+ import java .util .Collection ;
7
8
import java .util .HashMap ;
8
9
import java .util .List ;
9
10
import java .util .Map ;
@@ -123,7 +124,7 @@ private static BigDecimal handleHundred(BigDecimal currentChunk, String word, bo
123
124
return currentChunk .multiply (BigDecimal .valueOf (100 ));
124
125
}
125
126
126
- private static void handlePowerOfTen (List <BigDecimal > chunks , BigDecimal currentChunk , BigDecimal powerOfTen , String word , boolean prevNumWasPowerOfTen ) {
127
+ private static void handlePowerOfTen (Collection <BigDecimal > chunks , BigDecimal currentChunk , BigDecimal powerOfTen , String word , boolean prevNumWasPowerOfTen ) {
127
128
boolean currentChunkIsZero = currentChunk .compareTo (BigDecimal .ZERO ) == 0 ;
128
129
if (currentChunkIsZero || prevNumWasPowerOfTen ) {
129
130
throw new WordsToNumberException (WordsToNumberException .ErrorType .UNEXPECTED_WORD , word );
@@ -136,7 +137,7 @@ private static void handlePowerOfTen(List<BigDecimal> chunks, BigDecimal current
136
137
chunks .add (nextChunk );
137
138
}
138
139
139
- private static BigDecimal handleNumber (List <BigDecimal > chunks , BigDecimal currentChunk , String word , Integer number ) {
140
+ private static BigDecimal handleNumber (Collection <BigDecimal > chunks , BigDecimal currentChunk , String word , Integer number ) {
140
141
boolean currentChunkIsZero = currentChunk .compareTo (BigDecimal .ZERO ) == 0 ;
141
142
if (number == 0 && !(currentChunkIsZero && chunks .isEmpty ())) {
142
143
throw new WordsToNumberException (WordsToNumberException .ErrorType .UNEXPECTED_WORD , word );
0 commit comments