@Override
    public String getDefaultedBitmaskParameters() {
      ImmutableList.Builder<Integer> defaultedBitmasksBuilder = ImmutableList.builder();
      for (int bitBase = 0; bitBase < allProperties.size(); bitBase += 32) {
        int bitCount = min(32, allProperties.size() - bitBase);
        int defaultedBitmask = 0;
        for (int i = 0; i < bitCount; i++) {
          if (allProperties.get(bitBase + i).hasDefault()) {
            defaultedBitmask |= 1 << i;
          }
        }
        defaultedBitmasksBuilder.add(defaultedBitmask);
      }
      ImmutableList<Integer> defaultedBitmasks = defaultedBitmasksBuilder.build();
      return IntStream.range(0, bitmaskFields.size())
          .mapToObj(
              i -> {
                int defaultedBitmask = defaultedBitmasks.get(i);
                switch (defaultedBitmask) {
                  case 0:
                    return "0";
                  case ~0:
                    return "~" + bitmaskFields.get(i).name;
                  default:
                    return "~" + bitmaskFields.get(i).name + " & " + hex(defaultedBitmask);
                }
              })
          .collect(joining(",\n", ",\n", ",\nnull"));
    }
{@inheritDoc}

<p>When there are default parameters, we're calling the special constructor that has one or
more bitmask parameters at the end. Bit <i>i</i> is set if parameter <i>i</i> (zero-origin)
has its default value, and then the actual value passed for that parameter is ignored. Our
bitmask field has a 1 for any parameter that has been set, meaning it has a 0 for any
parameter that has been defaulted. So we need to invert it, and we also want to AND it with a
bitmask that selects just the bits for parameters with defaults. (The AND probably isn't
strictly necessary, since the constructor code doesn't actually look at those other bits, but
it seems cleaner.) If the bitmask for parameters with defaults is 0 then we can just use 0
for that bitmask, and if it is ~0 (all 1 bits) then we can skip the AND.

<p>That special constructor has an additional dummy parameter of type {@code
DefaultConstructorMarker}. We just pass {@code null} to that parameter.
value/src/main/java/com/google/auto/value/processor/BuilderRequiredProperties.java