@Test
  @SuppressWarnings({"rawtypes", "unchecked"}) // deliberately checking handling of raw types
  public void shouldGenerateBuildersWithComparators() {
    Comparator<String> stringComparator =
        new Comparator<String>() {
          @Override
          public int compare(String left, String right) {
            return left.compareTo(right);
          }
        };

    Comparator<Integer> intComparator =
        new Comparator<Integer>() {
          @Override
          public int compare(Integer o1, Integer o2) {
            return o1 - o2;
          }
        };

    Comparator comparator =
        new Comparator() {
          @Override
          public int compare(Object left, Object right) {
            return String.valueOf(left).compareTo(String.valueOf(right));
          }
        };

    AutoValueTest.DataWithSortedCollectionBuilders.Builder<String, Integer> builder =
        AutoValueTest.DataWithSortedCollectionBuilders.builder();

    builder
        .anImmutableSortedMapBuilder(stringComparator)
        .put("Charlie", 1)
        .put("Alfa", 2)
        .put("Bravo", 3);
    builder.anImmutableSortedSetBuilder(intComparator).add(1, 5, 9, 3);
    builder.nonGenericImmutableSortedMapBuilder(intComparator).put(9, 99).put(1, 11).put(3, 33);
    builder.rawImmutableSortedSetBuilder(comparator).add("Bravo", "Charlie", "Alfa");

    AutoValueTest.DataWithSortedCollectionBuilders<String, Integer> data = builder.build();

    AutoValueTest.DataWithSortedCollectionBuilders.Builder<String, Integer> copiedBuilder =
        data.toBuilder();
    AutoValueTest.DataWithSortedCollectionBuilders<String, Integer> copiedData =
        copiedBuilder.build();

    assertThat(data.anImmutableSortedMap().keySet())
        .containsExactly("Alfa", "Bravo", "Charlie")
        .inOrder();
    assertThat(data.anImmutableSortedSet()).containsExactly(1, 3, 5, 9).inOrder();
    assertThat(data.nonGenericImmutableSortedMap().keySet()).containsExactly(1, 3, 9).inOrder();
    assertThat(data.rawImmutableSortedSet()).containsExactly("Alfa", "Bravo", "Charlie").inOrder();

    assertThat(copiedData).isEqualTo(data);

    try {
      builder.anImmutableSortedMapBuilder(Ordering.from(stringComparator).reverse());
      fail("Calling property builder method a second time should have failed");
    } catch (IllegalStateException expected) {
    }
  }
Notice that this is called ReleaseInfoBuilder and not Builder.
value/src/it/functional/src/test/java/com/google/auto/value/AutoValueTest.java