Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

미션 제출합니다. #1

Open
wants to merge 45 commits into
base: songpang
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 38 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
1f05aa0
docs: 기능 목록 작성
Jummi10 Mar 30, 2021
d30dc74
feat: 입력 구현
Jummi10 Mar 30, 2021
fab2251
feat: 로또 도메인, 로또 번호 생성 구현
Jummi10 Mar 30, 2021
6b8c6e4
feat: 출력 메세지 분리
Jummi10 Mar 30, 2021
0e5b374
feat: 메세지 분리, 구입금액, 개수 입출력 구현
Jummi10 Mar 30, 2021
487ebd5
feat: 자동 번호 생성, 구입한 로또의 번호 출력
Jummi10 Mar 30, 2021
ee52f11
feat: 지난주 당첨 번호와 보너스 볼 입력 구현
Jummi10 Mar 30, 2021
f54c607
feat: 총 당첨 금액과 총 수익률 계산 구현
Jummi10 Mar 30, 2021
6ef3d82
feat: 당첨 통계, 수익률 출력 구현
Jummi10 Mar 30, 2021
8bf6bbb
test: 당첨 확인 기능 구현 테스트 작성
Jummi10 Mar 30, 2021
3410619
chore: 패키지 구조 변경
Jummi10 Mar 30, 2021
93200f9
feat: 입력, 출력, 예외 메세지 분리, 구입금액 예외처리 구현
Jummi10 Mar 30, 2021
a2a7041
feat: 1-45 숫자인 targetNumbers 일급 컬렉션 적용
Jummi10 Mar 30, 2021
ebd4470
refactor: target number 45개 중 앞 6개 숫자 가져오는 역할 TargetNumbers에게 위임
Jummi10 Mar 30, 2021
05f3a93
feat: 로또 티켓 하나의 숫자를 당첨 번호, 보너스 번호와 비교하는 기능 구현
Jummi10 Mar 31, 2021
7f1f4e1
feat: 지난주 당첨 번호 보너스볼 입력 검증 구현
Jummi10 Mar 31, 2021
121c3fa
feat: 구매한 로또 티켓들과 당첨 번호를 비교하는 기능 구현
Jummi10 Mar 31, 2021
69abefa
chore: 각 parameter명 수정, 숫자 상수화, 패키지 이동
Jummi10 Mar 31, 2021
0c75edc
feat: 각 티켓들의 결과로부터 당첨 통계 내는 기능 구현
Jummi10 Mar 31, 2021
402125c
chore: 패키지 구조 변경, Message 분리
Jummi10 Apr 1, 2021
2fe4dd3
refactor: 코드 병합
Jummi10 Apr 1, 2021
e4404d9
Update README.md
kouz95 Apr 4, 2021
1380c2a
Merge branch 'main' of https://github.com/biforest/java-lotto into Ju…
Jummi10 Apr 4, 2021
c2d856c
chore: 최소 최대 로또 번호 상수화
Jummi10 Apr 4, 2021
5514037
docs: 2단계 기능 목록 작성
Jummi10 Apr 6, 2021
df90ac2
feat: 로또 숫자 자동, 수동 생성 클래스 생성
Jummi10 Apr 6, 2021
1773b15
feat: 수동으로 구매할 로또 수와 번호 입력 구현
Jummi10 Apr 6, 2021
9036fc9
feat: 수동으로 입력받은 번호로 수동 로또 생성 구현
Jummi10 Apr 6, 2021
2cb46c7
chore: 패키지 구조 변경, 당첨통계 메세지 변경, Application 리팩토링
Jummi10 Apr 6, 2021
db7795d
refactor: 구매한 로또 번호와 지난주 당첨 번호 비교 로직을 Lotteries로 이동
Jummi10 Apr 6, 2021
ae631a6
refactor: validate 역할 위임
songpang Apr 8, 2021
8b6f339
refactor: Printer, Receiver 2단계 기능 적용
songpang Apr 8, 2021
bcf2ba5
refactor: Rankings 클래스 WinninggStatistics로 변경, 기존 WinningStatics 클래스 삭제
songpang Apr 8, 2021
7b6046a
refactor: PrizeMoney 클래스 내 값 관리 List에서 Map으로 변경
songpang Apr 8, 2021
ac27fbd
refactor: 기존 WinningStatics 역할, 함수 간결하게 리팩토링, ComparisonResult 클래스에 역…
songpang Apr 8, 2021
b395ceb
feat: 기능 변경에 따른 입/출력 클래스 수정
songpang Apr 8, 2021
602c118
refactor: 기능 변경에 따른 Application Class 변경
songpang Apr 8, 2021
9c0f645
refactor: 기능 변경에 따른 Test클래스 수정
songpang Apr 8, 2021
b230094
refactor: 디미터 법칙 적용을 위한 Lotteries 역할 Lottery에 위임
songpang Apr 14, 2021
9fd72e8
refactor: BeforeAll함수 생성
songpang Apr 14, 2021
4599417
refactor: 상태값 관리하지 않는 LotteryStore static으로 관리
songpang Apr 14, 2021
81dabd0
refactor: float형 double형으로 수정
songpang Apr 14, 2021
c3126e9
refactor: PrizeMoney 내부에 있던 상수 재사용을 위해 import
songpang Apr 14, 2021
7d3da15
refactor: 불필요한 getter사용 삭제 및 네이밍 수정
songpang Apr 14, 2021
2b80b87
refactor: 디미터의 법칙!
songpang Apr 14, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
123 changes: 123 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,60 @@
총 수익률은 0.35입니다.(기준이 1이기 때문에 결과적으로 손해라는 의미임)
```

# 🚀 로또 2단계 - 수동 구매

## 기능 요구사항
- 현재 로또 생성기는 자동 생성 기능만 제공한다. 사용자가 수동으로 추첨 번호를 입력할 수 있도록 해야 한다.
- 입력한 금액, 자동 생성 숫자, 수동 생성 번호를 입력하도록 해야 한다.

## 프로그래밍 요구사항
- 예외가 발생하는 부분에 대해 자바 Exception을 적용해 예외처리한다.
- 사용자가 입력한 값에 대한 예외 처리를 철저히 한다.

### 실행 결과
```
구입금액을 입력해 주세요.
14000

수동으로 구매할 로또 수를 입력해 주세요.
3

수동으로 구매할 번호를 입력해 주세요.
8, 21, 23, 41, 42, 43
3, 5, 11, 16, 32, 38
7, 11, 16, 35, 36, 44

수동으로 3장, 자동으로 11개를 구매했습니다.
[8, 21, 23, 41, 42, 43]
[3, 5, 11, 16, 32, 38]
[7, 11, 16, 35, 36, 44]
[1, 8, 11, 31, 41, 42]
[13, 14, 16, 38, 42, 45]
[7, 11, 30, 40, 42, 43]
[2, 13, 22, 32, 38, 45]
[23, 25, 33, 36, 39, 41]
[1, 3, 5, 14, 22, 45]
[5, 9, 38, 41, 43, 44]
[2, 8, 9, 18, 19, 21]
[13, 14, 18, 21, 23, 35]
[17, 21, 29, 37, 42, 45]
[3, 8, 27, 30, 35, 44]

지난 주 당첨 번호를 입력해 주세요.
1, 2, 3, 4, 5, 6
보너스 볼을 입력해 주세요.
7

당첨 통계
---------
3개 일치 (5000원)- 1개
4개 일치 (50000원)- 0개
5개 일치 (1500000원)- 0개
5개 일치, 보너스 볼 일치(30000000원) - 0개
6개 일치 (2000000000원)- 0개
총 수익률은 0.35입니다.(기준이 1이기 때문에 결과적으로 손해라는 의미임)
```

## 프로그래밍 요구사항
- indent(인덴트, 들여쓰기) depth를 2단계에서 1단계로 줄여라.
- depth의 경우 if문을 사용하는 경우 1단계의 depth가 증가한다. if문 안에 while문을 사용한다면 depth가 2단계가 된다.
Expand All @@ -51,6 +105,75 @@
- 규칙 8: 일급 콜렉션을 쓴다.

## 힌트

- 로또 자동 생성은 Collections.shuffle() 메소드 활용한다.
- Collections.sort() 메소드를 활용해 정렬 가능하다.
- ArrayList의 contains() 메소드를 활용하면 어떤 값이 존재하는지 유무를 판단할 수 있다.

___

### 1단계 기능 목록

- [x] 구입금액 입력
- [x] 예외
- [x] 구입한 로또 개수 출력
- [x] 개수만큼 로또 번호 출력
- [x] 번호 자동 생성
- [x] 지난주 당첨 번호와 보너스 볼 입력
- [x] 예외
- [x] 번호 비교
- [x] 당첨 통계 출력
- [x] 수익률 계산 및 출력

### 예외

- 구입 금액 입력
- [x] 구입금액이 0원 이하인 경우
- 당첨 번호와 보너스 볼 입력
- [x] 지난 주 당첨 번호가 중복되었을 경우
- [x] 당첨 번호가 1-45가 아닐 경우
- [x] 당첨 번호 입력에 숫자와 쉼표가 아닌 글자가 들어간 경우
- [x] 당첨 번호 개수가 6개가 아닐 경우

### 2단계 기능 목록

- [x] 숫자를 가진 클래스 분류
- [x] 수동으로 구매할 로또 수 입력
- [x] 수동으로 구매할 번호 입력
- [x] 수동 로또 생성
- [x] Printer %s, %f 사용
- [x] LotteryComparator 기능을 Lotteries로 합치기
- [ ] PrizeMoney로 당첨 횟수 세기

### 논의거리

- 일급컬렉션, 원시값 래핑 잘 했는지
- 테스트 커버리지

- BonusNumber 생성자에 winningNumbers가 들어가는거
- validate 메서드들 try-catch 해주기
- WinningStatistics if분기 어떻게 처리할건지
- enum에서 값을 변경해도 되는지

### LotteryNumber

- 최소(1), 최대(45) 값
- validate range

### 숫자를 가지는 클래스

- Numbers: 6개 List<Integer>
- Lottery가 만들어질 때 TargetNumbers로부터 받음
- 당첨 번호 6개와 비교
- [x] LotteryNumber
- 최댓값, 최솟값, 검증 로직 가지는 부모 클래스
- [x] TargetNumbers: 45개 -> AutoNumbersGenerator
- 자동 생성
- shuffle, 앞의 6개 숫자 가져오기 -> Numbers
- 범위 검증 필요 X
- 최댓값, 최솟값 필요 O
- [x] WinningNumbers: 6개 -> ManualNumbersGenerator
- 입력 받음, 수동 생성
- 범위 검증 필요
- [x] BonusNumber: 1개
- 범위 검증 필요
47 changes: 47 additions & 0 deletions src/main/java/Application.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import java.util.List;

import domain.lotteryStore.Lotteries;
import domain.lotteryStore.LotteryStore;
import domain.lotteryStore.PurchasePrice;
import domain.lotteryStore.numbers.BonusNumber;
import domain.lotteryStore.numbers.ManualNumbersGenerator;
import domain.winningStatistics.PrizeMoney;
import domain.winningStatistics.WinningStatistics;
import ui.Printer;
import ui.Receiver;

public class Application {
private final Receiver receiver;
private final Printer printer;
private final LotteryStore lotteryStore;

public Application() {
lotteryStore = new LotteryStore();
receiver = new Receiver();
printer = new Printer();
}

public static void main(String[] args) {
Application application = new Application();
application.run();
}

public void run() {
PurchasePrice purchasePrice = new PurchasePrice(receiver.receivePurchasePrice());
int purchasedCount = purchasePrice.getPurchasedCount();
int manualCount = receiver.receiveManualCount();
List<String> manualNumbers = receiver.receiveManualNumbers(manualCount);
printer.printPurchasedCount(manualCount, purchasedCount);

Lotteries lotteries = lotteryStore.createLotteries(purchasedCount, manualCount, manualNumbers);
printer.printPurchasedLotteries(lotteries);

ManualNumbersGenerator winningNumbers = new ManualNumbersGenerator(receiver.receiveWinningNumbers());
BonusNumber bonusNumber = new BonusNumber(receiver.receiveBonusNumber(), winningNumbers);

WinningStatistics winningStatistics = lotteries.compareWithWinningNumbersAndBonusNumber(winningNumbers, bonusNumber);

printer.printWinningStatistics(winningStatistics);
printer.printTotalEarningsRate(PrizeMoney.calculateEarningsRate(winningStatistics, purchasedCount));
}
}
50 changes: 50 additions & 0 deletions src/main/java/domain/lotteryStore/Lotteries.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package domain.lotteryStore;

import java.util.List;

import domain.lotteryStore.numbers.BonusNumber;
import domain.lotteryStore.numbers.ManualNumbersGenerator;
import domain.winningStatistics.ComparisonResult;
import domain.winningStatistics.WinningStatistics;

public class Lotteries {
private final List<Lottery> lotteries;

public Lotteries(List<Lottery> lotteries) {
this.lotteries = lotteries;
}

public WinningStatistics compareWithWinningNumbersAndBonusNumber(ManualNumbersGenerator winningNumbers,
BonusNumber bonusNumber) {
Comment on lines +17 to +18
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ManualNumberGenerator는 이름만 봐서 로또 번호를 생성하여 반환하는 기능을 담당하는 것으로 보여지는데, 이 메서드에서 쓰이기에는 일급 컬렉션으로도 쓰이고 있는 것 같네요.

저는 로또 번호 6개를 포장하는 다른 도메인을 생각해보는게 좋다고 생각합니다.
❓ 어떻게 생각하시나요?

WinningStatistics winningStatistics = new WinningStatistics();
for (Lottery lottery : lotteries) {
ComparisonResult comparisonResult = compareOneTicketNumbers(winningNumbers, bonusNumber, lottery);
comparisonResult.checkRanking(winningStatistics);
}

return winningStatistics;
}

public ComparisonResult compareOneTicketNumbers(ManualNumbersGenerator winningNumbers, BonusNumber bonusNumber,
Lottery lottery) {
int countOfMatchingNumbers = getCountOfMatchingWinningNumbers(lottery, winningNumbers);
boolean hasBonusNumber = hasBonusNumber(lottery, bonusNumber);
return new ComparisonResult(countOfMatchingNumbers, hasBonusNumber);
}

private int getCountOfMatchingWinningNumbers(Lottery lottery, ManualNumbersGenerator winningNumbers) {
return lottery.getNumbers().countMatchingNumbers(winningNumbers);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

디미터 법칙을 지켜볼까요?

디미터 법칙을 따르다보면 lottery가 여러 행동들을 가질수 있을 것 같아요.

}

private boolean hasBonusNumber(Lottery lottery, BonusNumber bonusNumber) {
return lottery.getNumbers().contains(bonusNumber.getBonusNumber());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}

public Lottery get(int index) {
return lotteries.get(index);
}

public List<Lottery> getLotteries() {
return lotteries;
}
}
15 changes: 15 additions & 0 deletions src/main/java/domain/lotteryStore/Lottery.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package domain.lotteryStore;

import domain.lotteryStore.numbers.Numbers;

public class Lottery {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lottery는 getter만 가지고 있는 자료구조 객체로 남기에는 아쉽네요 😢

private final Numbers numbers;

public Lottery(Numbers numbers) {
this.numbers = numbers;
}

public Numbers getNumbers() {
return numbers;
}
}
46 changes: 46 additions & 0 deletions src/main/java/domain/lotteryStore/LotteryStore.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package domain.lotteryStore;

import java.util.ArrayList;
import java.util.List;

import domain.lotteryStore.numbers.AutoNumbersGenerator;
import domain.lotteryStore.numbers.ManualNumbersGenerator;
import domain.lotteryStore.numbers.Numbers;

public class LotteryStore {
public Lotteries createLotteries(int purchasedCount, int manualCount, List<String> manualNumbers) {
List<Lottery> lotteries = new ArrayList<>();
List<Lottery> manualLotteries = makeManualLotteries(manualCount, manualNumbers);
List<Lottery> autoLotteries = makeAutoLotteries(purchasedCount, manualCount);

lotteries.addAll(manualLotteries);
lotteries.addAll(autoLotteries);

return new Lotteries(lotteries);
}

private List<Lottery> makeManualLotteries(int manualCount, List<String> manualNumbers) {
List<Lottery> manualLotteries = new ArrayList<>();
for (int i = 0; i < manualCount; i++) {
Numbers numbers = new Numbers(new ManualNumbersGenerator(manualNumbers.get(i)).getManualNumbers());
manualLotteries.add(new Lottery(numbers));
}
return manualLotteries;
}

private List<Lottery> makeAutoLotteries(int purchasedCount, int manualCount) {
AutoNumbersGenerator autoNumbersGenerator = new AutoNumbersGenerator();
List<Lottery> autoLotteries = new ArrayList<>();
int autoCount = purchasedCount - manualCount;
while (autoCount-- > 0) {
autoLotteries.add(makeAutoLottery(autoNumbersGenerator));
}
return autoLotteries;
}

private Lottery makeAutoLottery(AutoNumbersGenerator autoNumbersGenerator) {
autoNumbersGenerator.shuffle();
Numbers numbers = new Numbers(autoNumbersGenerator.getSixNumbersFromTheFront());
return new Lottery(numbers);
}
}
24 changes: 24 additions & 0 deletions src/main/java/domain/lotteryStore/PurchasePrice.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package domain.lotteryStore;

import ui.message.ExceptionMessage;

public class PurchasePrice {
private static final int PRICE_OF_ONE_LOTTERY_TICKET = 1000;

private final int purchasePrice;

public PurchasePrice(int purchasePrice) {
validateSmallerThanPurchasePrice(purchasePrice);
this.purchasePrice = purchasePrice;
}

private void validateSmallerThanPurchasePrice(int purchasePrice) {
if (purchasePrice < PRICE_OF_ONE_LOTTERY_TICKET) {
throw new IllegalArgumentException(ExceptionMessage.MUST_BUY_MORE_THAN_ONE_TICKET.getMessage());
}
}

public int getPurchasedCount() {
return purchasePrice / PRICE_OF_ONE_LOTTERY_TICKET;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package domain.lotteryStore.numbers;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;

public class AutoNumbersGenerator {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ManualNumbersGenerator와 AutoNumbersGenerator를 따로 정의한 이유는 무엇인가요?
수동으로 생성한 숫자와 자동으로 생성한 숫자는 다른 특성을 가지고 있나요?

제 개인적인 의견으로는 자동이든 수동이든

  • 중복된 로또 번호를 가질 수 없고,
  • 6개의 숫자가 생성 돼야 하는 특징을 공유하고 있어서

이와 관련한 속성을 한 객체에서 관리하되 생성하는 로직을 외부에서 변경할 수 있도록 제공하는 편이 낫다고 생각합니다.

다른 의견 있으시다면 남겨주세요!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

음,, 관리하는 객체의 관점에서 사실 자동/수동에서 차이가 있다고 생각했었는데요. 사실 수동/자동의 번호 공통적인 특징에서 볼 때는 동민님 의견의 맞다고 생각합니다.
하지만 생성과정에서 볼 때 사용자 입력을 받아서 검증하는 로직이 필요한 수동번호와
그럴 필요가 없고 1-45번호를 생성하여 셔플해야 하는 자동번호가 같은 객체에서 관리되어야 하나라는 생각이 들었어요.

만약에 한 객체에서 관리하게 된다면 어떤 경우에는 불필요한 로직이 추가되는 것이 아닐까요?

private final List<Integer> autoNumbers = new ArrayList<>();

public AutoNumbersGenerator() {
initiateNumbers();
}

private void initiateNumbers() {
for (int i = LotteryNumberRange.MINIMUM_LOTTERY_NUMBER; i <= LotteryNumberRange.MAXIMUM_LOTTERY_NUMBER; i++) {
autoNumbers.add(i);
}
}

public void shuffle() {
Collections.shuffle(autoNumbers);
}

public List<Integer> getSixNumbersFromTheFront() {
return autoNumbers.stream()
.limit(6)
.collect(Collectors.toList());
}
}
24 changes: 24 additions & 0 deletions src/main/java/domain/lotteryStore/numbers/BonusNumber.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package domain.lotteryStore.numbers;

import ui.message.ExceptionMessage;

public class BonusNumber extends LotteryNumberRange {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BonusNumber가 LotteryNumberRange를 상속한 이유는 무엇인가요??

로또 번호와 관련한 도메인을 따로 패키지를 만들만큼 많은 클래스가 나왔는데 하나의 객체에서 관리할 수 있지 않을까요?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LotteryNumberRange에 제약사항들을 넣어서 관련한 클래스들에 영향을 주기 위해서 였어요. 좋지않은 방법일까요?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

생각해보니까 LSP를 위반하는 설계였네요,,, 수정해보겠슴니당 ㅠㅠ

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BonusNumber is a LotteryNumberRange가 성립하나요?

LSP를 위반하고 있는건 아닐까요? 🤔

private final int bonusNumber;

public BonusNumber(int bonusNumber, ManualNumbersGenerator winningNumbers) {
validateRange(bonusNumber);
validateDuplicate(bonusNumber, winningNumbers);
this.bonusNumber = bonusNumber;
}

public void validateDuplicate(int bonusNumber, ManualNumbersGenerator winningNumbers) {
if (winningNumbers.contains(bonusNumber)) {
throw new IllegalArgumentException(
ExceptionMessage.BONUS_NUMBER_CANNOT_EQUAL_WINNING_NUMBERS.getMessage());
}
}

public int getBonusNumber() {
return bonusNumber;
}
}
18 changes: 18 additions & 0 deletions src/main/java/domain/lotteryStore/numbers/LotteryNumberRange.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package domain.lotteryStore.numbers;

import ui.message.ExceptionMessage;

public class LotteryNumberRange {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

public static 상수를 제공함과 동시에 검증하는 비즈니스 로직을 담고 있습니다.
지금은 validateRange를 util성 메서드로 제공함으로써 절차 지향적이라고 생각됩니다.

한 객체 내에서 상수를 private화하고 로또 번호 검증과 생성을 동시에 할 수 있지 않을까요?

public static final int MINIMUM_LOTTERY_NUMBER = 1;
public static final int MAXIMUM_LOTTERY_NUMBER = 45;

public void validateRange(int number) {
if (!isInValidRange(number)) {
throw new IllegalArgumentException(ExceptionMessage.MUST_INPUT_NUMBERS_IN_VALID_RANGE.getMessage());
}
}

private boolean isInValidRange(Integer number) {
return number >= MINIMUM_LOTTERY_NUMBER && number <= MAXIMUM_LOTTERY_NUMBER;
}
}
Loading