-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
25 lines (16 loc) · 783 Bytes
/
Main.java
File metadata and controls
25 lines (16 loc) · 783 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package exercise;
import exercise.model.Contact;
import java.io.IOException;
import java.util.List;
import static exercise.model.Gender.FEMALE;
public class Main {
public static final String FILE_NAME = "src/testdata/address-book.csv";
public static void main(String[] args) throws IOException {
FileParserService parserService = new FileParserService();
AddressBookService addressBookService = new AddressBookService();
List<List<String>> lines = parserService.readFromCsv(FILE_NAME);
List<Contact> contacts = addressBookService.createContacts(lines);
long femaleCount = addressBookService.getPersonCountByGender(contacts, FEMALE);
System.out.println("Number of females inside address book: " + femaleCount);
}
}