A DESCRIPTION OF THE PROBLEM :
There should be an overloaded method to Optional.orElseThrows that accepts a String, then throws a NoSuchElementException with the String argument passed into the constructor. This is much more convenient than Optional.orElseThrows(() -> throw new NoSuchElementException(" error message "));
There should be an overloaded method to Optional.orElseThrows that accepts a String, then throws a NoSuchElementException with the String argument passed into the constructor. This is much more convenient than Optional.orElseThrows(() -> throw new NoSuchElementException(" error message "));