class BitsToTransform {

  public int calculate(int numA, int numB) {
    int differentBits = 0;
    for (int XOR = numA ^ numB; XOR != 0; XOR = XOR & (XOR - 1)) {
      differentBits++;
    }
    return differentBits;
  }

}