code: public String deduceLanguageFromUri(String uri) throws LanguagesNotSetException, NotSupportedLanguageException {
          if ( ! areLanguagesSet()) throw new LanguagesNotSetException();
          
          int start = uri.charAt(0) == '/' ? 1 : 0,
              end   = uri.indexOf('/', 1);
          
          if (end < 1) end = uri.length();
          
          String lang = uri.substring(start, end);
          
          if(isLanguageSupported(lang)) return lang;
          throw new NotSupportedLanguageException();
      }
docs: Finds the language segment of the URI if the language property is set.
  Just looks at the first segment.
  <p>
  Fails fast if languages are not set
  
  @param uri
  The full URI
  @return
  the extracted language segment.
  @throws LanguagesNotSetException
  If {@link #areLanguagesSet()} returns false
  @throws NotSupportedLanguageException
  If the extracted language is not on the list of supported languages provided by the user