code: public Label getLabelByName(String name) {
          for (Label label : labels) {
              if (name.equals(label.getName())) {
                  return label;
              }
          }
          return null;
      }
docs: Returns label with specified name from the label list for
  this labeled statement.  Returns {@code null} if there is no
  label with that name in the list.