Java Optional.get()

Java Optional.get() is a method in the Java Optional class that retrieves the value inside the Optional if present, throwing a NoSuchElementException if it is empty. This method is typically used when it is certain that the Optional contains a value. Introduced in Java 2014 with Java 8, get() is often replaced by safer methods like orElse() or ifPresent().

https://docs.oracle.com/javase/8/docs/api/java/util/Optional.html