code: private static void determineFirstDigit(StringBuilder resultString, int lgPatternFound)
        throws NotFoundException {
      for (int d = 0; d < 10; d++) {
        if (lgPatternFound == FIRST_DIGIT_ENCODINGS[d]) {
          resultString.insert(0, (char) ('0' + d));
          return;
        }
      }
      throw NotFoundException.getNotFoundInstance();
    }
docs: Based on pattern of odd-even ('L' and 'G') patterns used to encoded the explicitly-encoded
  digits in a barcode, determines the implicitly encoded first digit and adds it to the
  result string.
  
  @param resultString string to insert decoded first digit into
  @param lgPatternFound int whose bits indicates the pattern of odd/even L/G patterns used to
  encode digits
  @throws NotFoundException if first digit cannot be determined