private void usingOrElseThrow() throws Exception {
  Optional<Student> studentOptional=null;
  studentOptional.orElseThrow(null);
}

private void usingOrElseThrow ( ) throws Exception { Optional < Student > studentOptional = null ; studentOptional . orElseThrow ( null ) ; }
use orelsethrow to throw an exception if we are expecting an exception
