def collect_level level , objects
      next_level = Array.new
      #puts "collect level #{level} #{objects.length}"
      objects.each do |object|
        #puts "collect level #{level} #{object.object_id}"
        # not storing simple (value) objects
        next if is_value?(object)
        case object.class.name
        when "Array" , "Parfait::List"
          collect_array object , next_level
        when "Hash" , "Parfait::Dictionary"
          collect_hash object, next_level
        else
          # and recursively add attributes
          attributes = attributes_for(object)
          attributes.each do |a|
            val = get_value( object , a)
            next_level << val
          end
          #TODO get all superclsses here, but this covers 99% so . . moving on
          superclasses = [object.class.superclass.name]
          if superclasses.include?( "Array") or superclasses.include?( "Parfait::List")
            collect_array object, next_level
          end
          if superclasses.include?( "Hash") or superclasses.include?( "Parfait::Dictionary")
            collect_hash object, next_level
          end
        end
      end
      new_objects = next_level.collect { |o| add_object(o , level + 1) }
      new_objects.compact!
      # recurse , but break off if hit bottom
      collect_level( level + 1 , new_objects) unless new_objects.empty?
    end
def collect_level level , objects
      next_level = Array.new
      #puts "collect level #{level} #{objects.length}"
      objects.each do |object|
        #puts "collect level #{level} #{object.object_id}"
        # not storing simple (value) objects
        next if is_value?(object)
        case object.class.name
        when "Array" , "Parfait::List"
          collect_array object , next_level
        when "Hash" , "Parfait::Dictionary"
          collect_hash object, next_level
        else
          # and recursively add attributes
          attributes = attributes_for(object)
          attributes.each do |a|
            val = get_value( object , a)
            next_level << val
          end
          #TODO get all superclsses here, but this covers 99% so . . moving on
          superclasses = [object.class.superclass.name]
          if superclasses.include?( "Array") or superclasses.include?( "Parfait::List")
            collect_array object, next_level
          end
          if superclasses.include?( "Hash") or superclasses.include?( "Parfait::Dictionary")
            collect_hash object, next_level
          end
        end
      end
      new_objects = next_level.collect { |o| add_object(o , level + 1) }
      new_objects.compact!
      # recurse , but break off if hit bottom
      collect_level( level + 1 , new_objects) unless new_objects.empty?
    end
recursively find reachable objects from this level of objects
 this is called from the initialize and is private
 we go through the tree in breadth first (which is a little more effort) to catch lowest
 references.