The Baeldung logo
  • The Baeldung Logo
  • Start Here
  • Spring Courses ▼▲
    • REST with Spring Boot

      The canonical reference for building a production grade API with Spring

    • Learn Spring Security

      THE unique Spring Security education if you’re working with Java today

    • Learn Spring

      From no experience to actually building stuff​

    • Learn Spring Data JPA

      The full guide to persistence with Spring Data JPA

    • View All Spring Courses

  • Java Courses ▼▲
    • Learn JUnit

      Master the most popular Java testing framework.

    • Learn Maven

      Simplify Your Build with Apache Maven

    • Learn Hibernate JPA

      Master persistence with the Java specification and Hibernate implementation

    • Learn Mockito

      Enhance your unit tests through practical mocking

    • View All Courses

  • Pricing
  • About ▼▲
    • Full Archive

      The high level overview of all the articles on the site.

    • Baeldung Ebooks

      Discover all of our eBooks

    • About Baeldung

      About Baeldung.

    Tag: Optional

    >> A Practical Guide to Null-Safety in Java With JSpecify

    • popular

    >> Avoid Check for Null Statement in Java

    • popular

    >> Java Optional – orElse() vs orElseGet()

    • popular

    >> How to Check if Optional Contains Value Equal to T Object

    >> Difference Between Optional.of() and Optional.ofNullable() in Java

    >> Perform Action Only if All Optionals Are Available

    >> Convert an Optional to an ArrayList in Java

    >> How to Implement Elvis Operator in Java

    >> Optional as a Record Parameter in Java

    >> Working With Empty Stream in Java

    >> Check if an Integer Value Is Null or Zero in Java

    >> Monads in Java – Optional

    >> Uses for Optional in Java

    >> Filter Java Stream to 1 and Only 1 Element

    >> Assert That a Java Optional Has a Certain Value

    >> Check for null Before Calling Parse in Double.parseDouble

    >> Java Optional as Return Type

    >> Transforming an Empty String into an Empty Optional

    >> Throw Exception in Java Optional

    >> Optional orElse Optional

    • ↑ Back to Top
    • 1
    • 2
    • Next →
    The Baeldung logo

    Courses

    • All Courses
    • Baeldung All Access
    • Baeldung All Team Access
    • Login Course Platform

    Series

    • Java “Back to Basics” Tutorial
    • Learn Spring Boot Series
    • Spring Tutorial
    • Get Started with Java
    • Spring Framework Introduction
    • All About String in Java
    • Security with Spring

    About

    • About Baeldung
    • The Full Archive
    • Editors
    • Our Partners
    • Partner with Baeldung
    • eBooks
    • FAQ
    • Baeldung Pro
    • Terms of Service
    • Privacy Policy
    • Company Info
    • Contact
    The Baeldung Logo