@Test
  public void readonly() throws Exception {
    ReadonlyRepository repo = new ReadonlyRepository(context.setup());

    // index method should be present. Make it compile time check
    repo.index().withName().ensure().getUnchecked();

    // ensure write methods are missing
    check(methodsByName(ReadonlyRepository.class, "andModifyFirst")).isEmpty();
    check(methodsByName(ReadonlyRepository.class, "andReplaceFirst")).isEmpty();
    check(methodsByName(ReadonlyRepository.class, "update")).isEmpty();
    check(methodsByName(ReadonlyRepository.class, "upsert")).isEmpty();
    check(methodsByName(ReadonlyRepository.class, "insert")).isEmpty();

    check(methodsByName(ReadonlyRepository.Finder.class, "deleteFirst")).isEmpty();
    check(methodsByName(ReadonlyRepository.Finder.class, "deleteAll")).isEmpty();
    check(methodsByName(ReadonlyRepository.Finder.class, "delete")).isEmpty();
    check(methodsByName(ReadonlyRepository.Finder.class, "andModifyFirst")).isEmpty();
    check(methodsByName(ReadonlyRepository.Finder.class, "andReplaceFirst")).isEmpty();
  }
Ensures read / write / index methods are present / absent from generated repositories after some flags have been
set using {@link org.immutables.mongo.Mongo.Repository} annotation.
mongo/test/org/immutables/mongo/fixture/flags/FlagsTest.java