Skip to content

Optional (Sergey Dorofeev)#29

Open
SuperflySD wants to merge 1 commit intojava8-course:masterfrom
SuperflySD:task1
Open

Optional (Sergey Dorofeev)#29
SuperflySD wants to merge 1 commit intojava8-course:masterfrom
SuperflySD:task1

Conversation

@SuperflySD
Copy link

Optional (Sergey Dorofeev)

@SuperflySD SuperflySD changed the title optional Optional (Sergey Dorofeev) Jun 24, 2017
final Optional<Integer> actual;

if (o1.isPresent()) {
actual = Optional.of(getLengthOpt.apply(o1.get()).get());
Copy link
Contributor

Choose a reason for hiding this comment

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

Incorrect.

final Optional<String> actual;

if (o1.isPresent()) {
actual = predicate.test(o1.get()) ? Optional.of(o1.get()) : Optional.empty();
Copy link
Contributor

Choose a reason for hiding this comment

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

Optional.of(opt.get()) == opt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants