code: @SuppressWarnings("unchecked")
      @Override
      public <T> Optional<T> getOptionalValue(String propertyName, Class<T> propertyType) {
          assertNotClosed();
          SourcedValue sourced = getSourcedValue(propertyName, propertyType);
          T value = null;
          if (sourced != null) {
              value = (T) sourced.getValue();
          }
          Optional<T> optional = Optional.ofNullable(value);
          return optional;
      }
docs: {@inheritDoc}