docs: private static int getFinalTarget(CFG cfg, int myPos, Collection<InstructionHandle> prevs) {
          int maxGoto = 0;
          BasicBlock myBB = null;
          // note: InstructionHandle doesn't override equals(), so use
          // prevs.contains() with caution.
          Iterator<BasicBlock> bbi = cfg.blockIterator();
          while (bbi.hasNext()) {
              BasicBlock bb = bbi.next();
              InstructionHandle last = bb.getLastInstruction(); // may be null
              if (prevs.contains(last)) { // danger will robinson
                  Iterator<Edge> iei = cfg.outgoingEdgeIterator(bb);
                  while (iei.hasNext()) {
                      Edge e = iei.next();
                      int eType = e.getType();
                      if (eType == EdgeTypes.GOTO_EDGE) {
                          BasicBlock target = e.getTarget();
                          InstructionHandle targetFirst = getDeepFirstInstruction(cfg, target);
                          if (targetFirst != null) {
                              int targetPos = targetFirst.getPosition();
                              if (targetPos > maxGoto) {
                                  maxGoto = targetPos;
                              }
                          }
                      }
                  }
              } else if (last != null && myPos == bb.getFirstInstruction().getPosition()) {
                  // note: getFirstInstruction() may return null, but won't if
                  // last!=null.
                  myBB = bb; // used in case (c) below
              }
          }
          /*
           * ok, there are three cases: a) maxGoto == myPos: There is no default
           * case within the switch. b) maxGoto > myPos: maxGoto is the end
           * (exclusive) of the default case c) maxGoto < myPos: all the cases do
           * something like return or throw, so who knows if there is a default
           * case (and it's length)?
           */
          if (maxGoto < myPos && myBB != null) {
              /*
               * We're in case (c), so let's guess that the end of the basic block
               * is the end of the default case (if it exists). This may give
               * false negatives (if the default case has branches, for example)
               * but shouldn't give false negatives (because if it matches one of
               * the cases, then it has also matched that case's return/throw).
               */
              InstructionHandle last = myBB.getLastInstruction();
              if (last != null) {
                  // note: last.getNext() may return null, so do it this way
                  return last.getPosition() + last.getInstruction().getLength();
              }
          }
          return maxGoto;
      }