Skip to content

Commit 9b25947

Browse files
committed
Rename methods
1 parent fc4e100 commit 9b25947

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/main/java/io/github/aplotnikov/java_8_misuses/optional/OptionalOrThrow.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class OptionalOrThrow {
1111

1212
@Ugly
1313
class ManualCheckForPresenceToThrowException {
14-
Loan getLoan(Client client) {
14+
Loan getLastLoan(Client client) {
1515
if (client.findLastLoan().isPresent()) {
1616
return client.findLastLoan().get();
1717
}
@@ -37,7 +37,7 @@ private void delete(Loan loan) {
3737

3838
@Good
3939
class OrElseThrowUsage {
40-
Loan getLoan(Client client) {
40+
Loan getLastLoan(Client client) {
4141
return client.findLastLoan()
4242
.orElseThrow(() -> new IllegalStateException("Client does not have any loans"));
4343
}

0 commit comments

Comments
 (0)