code: private void addPropertyStateCheckMethod(String name, int state) {
          MethodInfo mi = addMethodIfNotFinal(Modifiers.PUBLIC, name,
                                              TypeDesc.BOOLEAN, new TypeDesc[] {TypeDesc.STRING});
  
          if (mi == null) {
              return;
          }
  
          CodeBuilder b = new CodeBuilder(mi);
  
          // Call private method to extract state and compare.
          b.loadThis();
          b.loadLocal(b.getParameter(0));
          b.invokePrivate(PROPERTY_STATE_EXTRACT_METHOD_NAME,
                          TypeDesc.INT, new TypeDesc[] {TypeDesc.STRING});
          Label isFalse = b.createLabel();
          if (state == 0) {
              b.ifZeroComparisonBranch(isFalse, "!=");
          } else {
              b.loadConstant(state);
              b.ifComparisonBranch(isFalse, "!=");
          }
          b.loadConstant(true);
          b.returnValue(TypeDesc.BOOLEAN);
          isFalse.setLocation();
          b.loadConstant(false);
          b.returnValue(TypeDesc.BOOLEAN);
      }
docs: Generates public method which accepts a property name and returns a
  boolean true, if the given state matches the property's actual state.
  
  @param name name of method
  @param state property state to check