test reference counted and garbage collected boxes