added testcode for generator