class AncestorEquality implements Equality {

    @Override
    public boolean partOf(Key key, Key other) {
        String docId = key.getColumnFamily().toString();
        String otherId = other.getColumnFamily().toString();
        return docId.startsWith(otherId + DEFAULT_SEPARATOR) || docId.equals(otherId);
    }

}