func TestObjxMap(t *testing.T) {
	val := (objx.Map)(objx.New(1))
	m := objx.Map{"value": val, "value2": map[string]interface{}{"name": "Taylor"}, "nothing": nil}
	valMSI := objx.Map{"name": "Taylor"}
	assert.Equal(t, val, m.Get("value").ObjxMap())
	assert.Equal(t, valMSI, m.Get("value2").ObjxMap())
	assert.Equal(t, val, m.Get("value").MustObjxMap())
	assert.Equal(t, valMSI, m.Get("value2").MustObjxMap())
	assert.Equal(t, (objx.Map)(objx.New(nil)), m.Get("nothing").ObjxMap())
	assert.Equal(t, val, m.Get("nothing").ObjxMap(objx.New(1)))
	assert.Panics(t, func() {
		m.Get("age").MustObjxMap()
	})
}
/*
Tests for ObjxMap ((objx.Map) and [](objx.Map))
package objx_test
import (
	"fmt"
	"testing"
	"github.com/stretchr/objx"
	"github.com/stretchr/testify/assert"
)
func TestMSI(t *testing.T) {
	val := map[string]interface{}(map[string]interface{}{"name": "Tyler"})
	m := objx.Map{"value": val, "nothing": nil}
	mVal := map[string]interface{}{"value": val, "nothing": nil}
	assert.Equal(t, mVal, m.Value().MSI())
	assert.Equal(t, val, m.Get("value").MSI())
	assert.Equal(t, mVal, m.Value().MustMSI())
	assert.Equal(t, val, m.Get("value").MustMSI())
	assert.Equal(t, map[string]interface{}(nil), m.Get("nothing").MSI())
	assert.Equal(t, val, m.Get("nothing").MSI(map[string]interface{}{"name": "Tyler"}))
	assert.Panics(t, func() {
		m.Get("age").MustMSI()
	})
}
func TestMSISlice(t *testing.T) {
	val := map[string]interface{}(map[string]interface{}{"name": "Tyler"})
	m := objx.Map{
		"value":   []map[string]interface{}{val},
		"value2":  []objx.Map{val},
		"value3":  []interface{}{val},
		"nothing": nil,
	}
	assert.Equal(t, val, m.Get("value").MSISlice()[0])
	assert.Equal(t, val, m.Get("value2").MSISlice()[0])
	assert.Equal(t, val, m.Get("value3").MSISlice()[0])
	assert.Equal(t, val, m.Get("value").MustMSISlice()[0])
	assert.Equal(t, val, m.Get("value2").MustMSISlice()[0])
	assert.Equal(t, val, m.Get("value3").MustMSISlice()[0])
	assert.Equal(t, []map[string]interface{}(nil), m.Get("nothing").MSISlice())
	assert.Equal(t, val, m.Get("nothing").MSISlice([]map[string]interface{}{map[string]interface{}(map[string]interface{}{"name": "Tyler"})})[0])
	assert.Panics(t, func() {
		m.Get("nothing").MustMSISlice()
	})
	o := objx.MustFromJSON(`{"d":[{"author":{"displayName":"DemoUser3","id":2},"classes":null,"id":9879,"v":{"code":"","created":"2013-09-19T09:38:50+02:00","published":"0001-01-01T00:00:00Z","updated":"2013-09-19T09:38:50+02:00"}}],"s":200}`)
	assert.Equal(t, float64(9879), o.Get("d").MustMSISlice()[0]["id"])
	assert.Equal(t, 1, len(o.Get("d").MSISlice()))
	i := objx.MustFromJSON(`{"d":[{"author":"abc"},[1]]}`)
	assert.Nil(t, i.Get("d").MSISlice())
}
func TestIsMSI(t *testing.T) {
	m := objx.Map{"data": map[string]interface{}(map[string]interface{}{"name": "Tyler"})}
	assert.True(t, m.Get("data").IsMSI())
	assert.True(t, m.Value().IsMSI())
}
func TestIsMSISlice(t *testing.T) {
	val := map[string]interface{}(map[string]interface{}{"name": "Tyler"})
	m := objx.Map{"data": []map[string]interface{}{val}, "data2": []objx.Map{val}}
	assert.True(t, m.Get("data").IsMSISlice())
	assert.True(t, m.Get("data2").IsMSISlice())
	o := objx.MustFromJSON(`{"d":[{"author":{"displayName":"DemoUser3","id":2},"classes":null,"id":9879,"v":{"code":"","created":"2013-09-19T09:38:50+02:00","published":"0001-01-01T00:00:00Z","updated":"2013-09-19T09:38:50+02:00"}}],"s":200}`)
	assert.True(t, o.Has("d"))
	assert.True(t, o.Get("d").IsMSISlice())
	o = objx.MustFromJSON(`{"d":[{"author":"abc"},[1]]}`)
	assert.True(t, o.Has("d"))
	assert.False(t, o.Get("d").IsMSISlice())
}
func TestEachMSI(t *testing.T) {
	m := objx.Map{"data": []map[string]interface{}{map[string]interface{}(map[string]interface{}{"name": "Tyler"}), map[string]interface{}(map[string]interface{}{"name": "Tyler"}), map[string]interface{}(map[string]interface{}{"name": "Tyler"}), map[string]interface{}(map[string]interface{}{"name": "Tyler"}), map[string]interface{}(map[string]interface{}{"name": "Tyler"})}}
	count := 0
	replacedVals := make([]map[string]interface{}, 0)
	assert.Equal(t, m.Get("data"), m.Get("data").EachMSI(func(i int, val map[string]interface{}) bool {
		count++
		replacedVals = append(replacedVals, val)
		return i != 2
	}))
	m2 := objx.Map{"data": []objx.Map{{"name": "Taylor"}, {"name": "Taylor"}, {"name": "Taylor"}, {"name": "Taylor"}, {"name": "Taylor"}}}
	assert.Equal(t, m2.Get("data"), m2.Get("data").EachMSI(func(i int, val map[string]interface{}) bool {
		count++
		replacedVals = append(replacedVals, val)
		return i != 2
	}))
	assert.Equal(t, count, 6)
	assert.Equal(t, replacedVals[0], m.Get("data").MustMSISlice()[0])
	assert.Equal(t, replacedVals[1], m.Get("data").MustMSISlice()[1])
	assert.Equal(t, replacedVals[2], m.Get("data").MustMSISlice()[2])
	assert.Equal(t, replacedVals[3], m2.Get("data").MustMSISlice()[0])
	assert.Equal(t, replacedVals[4], m2.Get("data").MustMSISlice()[1])
	assert.Equal(t, replacedVals[5], m2.Get("data").MustMSISlice()[2])
}
func TestWhereMSI(t *testing.T) {
	m := objx.Map{"data": []map[string]interface{}{map[string]interface{}(map[string]interface{}{"name": "Tyler"}), map[string]interface{}(map[string]interface{}{"name": "Tyler"}), map[string]interface{}(map[string]interface{}{"name": "Tyler"}), map[string]interface{}(map[string]interface{}{"name": "Tyler"}), map[string]interface{}(map[string]interface{}{"name": "Tyler"}), map[string]interface{}(map[string]interface{}{"name": "Tyler"})}}
	selected := m.Get("data").WhereMSI(func(i int, val map[string]interface{}) bool {
		return i%2 == 0
	}).MustMSISlice()
	assert.Equal(t, 3, len(selected))
}
func TestWhereMSI2(t *testing.T) {
	m := objx.Map{"data": []objx.Map{{"name": "Taylor"}, {"name": "Taylor"}, {"name": "Taylor"}, {"name": "Taylor"}, {"name": "Taylor"}}}
	selected := m.Get("data").WhereMSI(func(i int, val map[string]interface{}) bool {
		return i%2 == 0
	}).MustMSISlice()
	assert.Equal(t, 2, len(selected))
}
func TestGroupMSI(t *testing.T) {
	m := objx.Map{"data": []map[string]interface{}{map[string]interface{}(map[string]interface{}{"name": "Tyler"}), map[string]interface{}(map[string]interface{}{"name": "Tyler"}), map[string]interface{}(map[string]interface{}{"name": "Tyler"}), map[string]interface{}(map[string]interface{}{"name": "Tyler"}), map[string]interface{}(map[string]interface{}{"name": "Tyler"}), map[string]interface{}(map[string]interface{}{"name": "Tyler"})}}
	grouped := m.Get("data").GroupMSI(func(i int, val map[string]interface{}) string {
		return fmt.Sprintf("%v", i%2 == 0)
	}).Data().(map[string][]map[string]interface{})
	assert.Equal(t, 2, len(grouped))
	assert.Equal(t, 3, len(grouped["true"]))
	assert.Equal(t, 3, len(grouped["false"]))
}
func TestGroupMSI2(t *testing.T) {
	m := objx.Map{"data": []objx.Map{{"name": "Taylor"}, {"name": "Taylor"}, {"name": "Taylor"}, {"name": "Taylor"}, {"name": "Taylor"}}}
	grouped := m.Get("data").GroupMSI(func(i int, val map[string]interface{}) string {
		return fmt.Sprintf("%v", i%2 == 0)
	}).Data().(map[string][]map[string]interface{})
	assert.Equal(t, 2, len(grouped))
	assert.Equal(t, 3, len(grouped["true"]))
	assert.Equal(t, 2, len(grouped["false"]))
}
func TestReplaceMSI(t *testing.T) {
	m := objx.Map{"data": []map[string]interface{}{map[string]interface{}(map[string]interface{}{"name": "Tyler"}), map[string]interface{}(map[string]interface{}{"name": "Tyler"}), map[string]interface{}(map[string]interface{}{"name": "Tyler"}), map[string]interface{}(map[string]interface{}{"name": "Tyler"}), map[string]interface{}(map[string]interface{}{"name": "Tyler"}), map[string]interface{}(map[string]interface{}{"name": "Tyler"})}}
	rawArr := m.Get("data").MustMSISlice()
	replaced := m.Get("data").ReplaceMSI(func(index int, val map[string]interface{}) map[string]interface{} {
		if index < len(rawArr)-1 {
			return rawArr[index+1]
		}
		return rawArr[0]
	})
	replacedArr := replaced.MustMSISlice()
	if assert.Equal(t, 6, len(replacedArr)) {
		assert.Equal(t, replacedArr[0], rawArr[1])
		assert.Equal(t, replacedArr[1], rawArr[2])
		assert.Equal(t, replacedArr[2], rawArr[3])
		assert.Equal(t, replacedArr[3], rawArr[4])
		assert.Equal(t, replacedArr[4], rawArr[5])
		assert.Equal(t, replacedArr[5], rawArr[0])
	}
}
func TestReplaceMSI2(t *testing.T) {
	m := objx.Map{"data": []objx.Map{{"name": "Taylor"}, {"name": "Taylor"}, {"name": "Taylor"}, {"name": "Taylor"}, {"name": "Taylor"}}}
	rawArr := m.Get("data").MustMSISlice()
	replaced := m.Get("data").ReplaceMSI(func(index int, val map[string]interface{}) map[string]interface{} {
		if index < len(rawArr)-1 {
			return rawArr[index+1]
		}
		return rawArr[0]
	})
	replacedArr := replaced.MustMSISlice()
	if assert.Equal(t, 5, len(replacedArr)) {
		assert.Equal(t, replacedArr[0], rawArr[1])
		assert.Equal(t, replacedArr[1], rawArr[2])
		assert.Equal(t, replacedArr[2], rawArr[3])
		assert.Equal(t, replacedArr[3], rawArr[4])
		assert.Equal(t, replacedArr[4], rawArr[0])
	}
}
func TestCollectMSI(t *testing.T) {
	m := objx.Map{"data": []map[string]interface{}{map[string]interface{}(map[string]interface{}{"name": "Tyler"}), map[string]interface{}(map[string]interface{}{"name": "Tyler"}), map[string]interface{}(map[string]interface{}{"name": "Tyler"}), map[string]interface{}(map[string]interface{}{"name": "Tyler"}), map[string]interface{}(map[string]interface{}{"name": "Tyler"}), map[string]interface{}(map[string]interface{}{"name": "Tyler"})}}
	collected := m.Get("data").CollectMSI(func(index int, val map[string]interface{}) interface{} {
		return index
	})
	collectedArr := collected.MustInterSlice()
	if assert.Equal(t, 6, len(collectedArr)) {
		assert.Equal(t, collectedArr[0], 0)
		assert.Equal(t, collectedArr[1], 1)
		assert.Equal(t, collectedArr[2], 2)
		assert.Equal(t, collectedArr[3], 3)
		assert.Equal(t, collectedArr[4], 4)
		assert.Equal(t, collectedArr[5], 5)
	}
}
func TestCollectMSI2(t *testing.T) {
	m := objx.Map{"data": []objx.Map{{"name": "Taylor"}, {"name": "Taylor"}, {"name": "Taylor"}, {"name": "Taylor"}, {"name": "Taylor"}}}
	collected := m.Get("data").CollectMSI(func(index int, val map[string]interface{}) interface{} {
		return index
	})
	collectedArr := collected.MustInterSlice()
	if assert.Equal(t, 5, len(collectedArr)) {
		assert.Equal(t, collectedArr[0], 0)
		assert.Equal(t, collectedArr[1], 1)
		assert.Equal(t, collectedArr[2], 2)
		assert.Equal(t, collectedArr[3], 3)
		assert.Equal(t, collectedArr[4], 4)
	}
}