@Test
  protected void startsWith() {
    values(string.value.startsWith("a")).isEmpty();
    values(string.value.startsWith("")).isEmpty();

    repository.insert(generator.get().withValue("a"));
    repository.insert(generator.get().withValue("aa"));
    repository.insert(generator.get().withValue("b"));
    repository.insert(generator.get().withValue("bb"));

    values(string.value.startsWith("a")).hasContentInAnyOrder("a", "aa");
    values(string.value.startsWith("b")).hasContentInAnyOrder("b", "bb");
    values(string.value.startsWith("c")).isEmpty();
    values(string.value.startsWith("")).hasContentInAnyOrder("a", "aa", "b", "bb");
  }
Testing various string operations prefix/suffix/length etc.
criteria/common/test/org/immutables/criteria/typemodel/StringTemplate.java