Skip to content

Instantly share code, notes, and snippets.

@brilianfird
Created October 3, 2020 11:40
Show Gist options
  • Save brilianfird/9918745cc30c3158ffce8d3768e558b1 to your computer and use it in GitHub Desktop.
Save brilianfird/9918745cc30c3158ffce8d3768e558b1 to your computer and use it in GitHub Desktop.
@Test
public void initializeOptional_optionalOf() {
Optional<String> helloWorldOptional = Optional.of("Hello, world");
assert helloWorldOptional.isPresent();
assert "Hello, world".equals(helloWorldOptional.get());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment