docs: private String extractDeclarations(Match match) {
          final StringBuilder result = new StringBuilder();
          List<String> declarations = match.getDeclarationIds();
          Map<String, Declaration> declsMap = ( (AgendaItem) match ).getTerminalNode().getSubRule().getOuterDeclarations();
          for ( int i = 0; i < declarations.size(); i++ ) {
              String declaration = declarations.get(i);
  
              Declaration decl = declsMap.get(declaration);
              InternalFactHandle handle = ( (Tuple) match ).get( decl );
              if (!handle.isValid()) {
                  continue;
              }
              Object value = decl.getValue(null, handle.getObject());
  
              result.append( declaration );
              result.append( "=" );
              if ( value == null ) {
                  // this should never occur
                  result.append( "null" );
              } else {
                  result.append( value );
              }
              if ( i < declarations.size() - 1 ) {
                  result.append( "; " );
              }
          }
          return result.toString();
      }