Generalized helper function in unit tests used to create library items.