private void assertFacet(RepositoryModel.Facet facet, Class<? extends Facet> type) {
    // compare name
    check(facet.name()).is(type.getSimpleName().toLowerCase());

    // check interface type
    TypeElement canonical = rule.elements().getTypeElement(type.getCanonicalName());
    check(rule.types().asElement(facet.interfaceType())).is(canonical);

    // non-default non-Object methods are implemented
    final List<Method> methods = new ArrayList<>(Arrays.asList(type.getMethods()));
    methods.removeAll(Arrays.asList(Object.class.getMethods()));

    final List<String> actual = facet.methods().stream().map(RepositoryModel.DelegateMethod::name).collect(Collectors.toList());
    final List<String> expected = methods.stream().map(Method::getName).collect(Collectors.toList());
    check(actual).hasContentInAnyOrder(expected);
  }
Series of checks on existing facet
criteria/common/test/org/immutables/criteria/processor/RepositoryTest.java