code: public static int setInterface(int modifier, boolean b) {
          if (b) {
              return (modifier | (INTERFACE | ABSTRACT)) & 
                  (~FINAL & ~SYNCHRONIZED & ~VOLATILE & ~TRANSIENT & ~NATIVE);
          }
          else {
              return modifier & ~INTERFACE;
          }
      }
docs: When set as an interface, non-interface settings are cleared and the
  modifier is set abstract.