code: private void adjust(IDoubleBondStereochemistry dbs) {
  
          IBond db = dbs.getStereoBond();
          IBond[] bonds = dbs.getBonds();
  
          IAtom left = db.getBegin();
          IAtom right = db.getEnd();
  
          int p = parity(dbs);
          int q = parity(getAtoms(left, bonds[0].getOther(left), right))
                  * parity(getAtoms(right, bonds[1].getOther(right), left));
  
          // configuration is unspecified? then we add an unspecified bond.
          // note: IDoubleBondStereochemistry doesn't indicate this yet
          if (p == 0) {
              for (IBond bond : container.getConnectedBondsList(left))
                  bond.setStereo(IBond.Stereo.NONE);
              for (IBond bond : container.getConnectedBondsList(right))
                  bond.setStereo(IBond.Stereo.NONE);
              bonds[0].setStereo(IBond.Stereo.UP_OR_DOWN);
              return;
          }
  
          // configuration is already correct
          if (p == q) return;
  
          Arrays.fill(visited, false);
          visited[atomToIndex.get(left)] = true;
  
          if (ringSearch.cyclic(atomToIndex.get(left), atomToIndex.get(right))) {
              db.setStereo(IBond.Stereo.E_OR_Z);
              return;
          }
  
          for (int w : graph[atomToIndex.get(right)]) {
              if (!visited[w]) reflect(w, db);
          }
      }
docs: Adjust the configuration of the {@code dbs} element (if required).
  
  @param dbs double-bond stereochemistry element