introduce ElementStub for C++ testing