func MethodChainSortTest() string {
	return `
func TestSort<FTYPE>methodchain(t *testing.T) {
	var v1 <TYPE> = 1
	var v2 <TYPE> = 2
	var v3 <TYPE> = 3
	expected := []<TYPE>{v1, v2, v3}
	sorted :=  Make<FTYPE>Slice([]<TYPE>{v3, v2, v1}...).Sort()
	if expected[0] != sorted[0] || expected[1] != sorted[1] || expected[2] != sorted[2] {
		t.Errorf("Sort<Type>sMethodChain failed")
		t.Errorf(reflect.String.String())
	}
}
func TestSort<FTYPE>methodchainDesc(t *testing.T) {
	var v1 <TYPE> = 1
	var v2 <TYPE> = 2
	var v3 <TYPE> = 3
	expected := []<TYPE>{v3, v2, v1}
	sorted :=  Make<FTYPE>Slice([]<TYPE>{v3, v2, v1}...).SortDesc()
	if expected[0] != sorted[0] || expected[1] != sorted[1] || expected[2] != sorted[2] {
		t.Errorf("Sort<Type>sMethodChain failed")
		t.Errorf(reflect.String.String())
	}
}
func TestSort<FTYPE>methodchainPtr(t *testing.T) {
	var v1 <TYPE> = 1
	var v2 <TYPE> = 2
	var v3 <TYPE> = 3
	expected := []*<TYPE>{&v1, &v2, &v3}
	sorted :=  Make<FTYPE>SlicePtr([]*<TYPE>{&v3, &v2, &v1}...).SortPtr()
	if *expected[0] != *sorted[0] || *expected[1] != *sorted[1] || *expected[2] != *sorted[2] {
		t.Errorf("Sort<Type>sMethodChain failed")
	}
}
func TestSort<FTYPE>methodchainDescPtr(t *testing.T) {
	var v1 <TYPE> = 1
	var v2 <TYPE> = 2
	var v3 <TYPE> = 3
	expected := []*<TYPE>{&v3, &v2, &v1}
	sorted :=  Make<FTYPE>SlicePtr([]*<TYPE>{&v3, &v2, &v1}...).SortDescPtr()
	if *expected[0] != *sorted[0] || *expected[1] != *sorted[1] || *expected[2] != *sorted[2] {
		t.Errorf("Sort<Type>sMethodChain failed")
	}
}
`
}
MethodChainSortTest is template to generate itself for different combination of data type.
package methodchain
import (
	"strings"
)
func MethodChainMapTest() string {
	return `
func TestMap<FTYPE>MethodChain(t *testing.T) {
	expectedSquareList := []<TYPE>{1, 4, 9}
	squareList := Make<FTYPE>Slice([]<TYPE>{1, 2, 3}...).Map(square<FTYPE>)
	if squareList[0] != expectedSquareList[0] || squareList[1] != expectedSquareList[1] || squareList[2] != expectedSquareList[2] {
		t.Errorf("Map<FTYPE>MthodChain failed")
	}
	if len(Make<FTYPE>Slice().Map(square<FTYPE>)) > 0 {
		t.Errorf("Map<FTYPE> failed.")
		t.Errorf(reflect.String.String())
	}
}
func TestMap2<FTYPE>MethodChain(t *testing.T) {
	if len(Make<FTYPE>Slice().Map(nil)) > 0 {
		t.Errorf("Map<FTYPE> failed.")
		t.Errorf(reflect.String.String())
	}
}
func TestMap<FTYPE>MethodChainPtr(t *testing.T) {
	var v1 <TYPE> = 1
	var v2 <TYPE> = 2
	var v3 <TYPE> = 3
	var v4 <TYPE> = 4
	var v9 <TYPE> = 9
	expectedSquareList := []*<TYPE>{&v1, &v4, &v9}
	squareList := Make<FTYPE>SlicePtr([]*<TYPE>{&v1, &v2, &v3}...).MapPtr(square<FTYPE>Ptr)
	if *squareList[0] != *expectedSquareList[0] || *squareList[1] != *expectedSquareList[1] || *squareList[2] != *expectedSquareList[2] {
		t.Errorf("Map<FTYPE>PtrMthodChain failed")
	}
	if len(Make<FTYPE>SlicePtr().MapPtr(square<FTYPE>Ptr)) > 0 {
		t.Errorf("Map<FTYPE>Ptr failed.")
	}
}
func TestMapPtr2<FTYPE>MethodChain(t *testing.T) {
	if len(Make<FTYPE>SlicePtr().MapPtr(nil)) > 0 {
		t.Errorf("Map<FTYPE>Ptr failed.")
	}
}
func TestFilter<FTYPE>MethodChain(t *testing.T) {
	var v1 <TYPE> = 1
	var v2 <TYPE> = 2
	var v3 <TYPE> = 3
	greaterThan1<FTYPE>MethodChain := func(num <TYPE>) bool {
		return num > 1
	}
	expectedFilteredList := []<TYPE>{v2, v3}
	filteredList := Make<FTYPE>Slice([]<TYPE>{v1, v2, v3}...).Filter(greaterThan1<FTYPE>MethodChain)
	if filteredList[0] != expectedFilteredList[0] || filteredList[1] != expectedFilteredList[1] {
		t.Errorf("Filter<FTYPE> failed. Expected filtered list=%v, actual list=%v", expectedFilteredList, filteredList)
	}
}
func TestFilter2<FTYPE>MethodChain(t *testing.T) {
	if len(Make<FTYPE>Slice().Filter(nil)) > 0 {
		t.Errorf("Filter<FTYPE>Ptr failed.")
	}
}
func TestFilter<FTYPE>PtrMethodChain(t *testing.T) {
	var v1 <TYPE> = 1
	var v2 <TYPE> = 2
	var v3 <TYPE> = 3
	greaterThan1<FTYPE>MethodChain := func(num *<TYPE>) bool {
		return *num > 1
	}
	expectedFilteredList := []*<TYPE>{&v2, &v3}
	filteredList := Make<FTYPE>SlicePtr([]*<TYPE>{&v1, &v2, &v3}...).FilterPtr(greaterThan1<FTYPE>MethodChain)
	if *filteredList[0] != *expectedFilteredList[0] || *filteredList[1] != *expectedFilteredList[1] {
		t.Errorf("Filter<FTYPE>Ptr failed. Expected filtered list=%v, actual list=%v", expectedFilteredList, filteredList)
	}
}
func TestFilter2<FTYPE>PtrMethodChain(t *testing.T) {
	if len(Make<FTYPE>SlicePtr().FilterPtr(nil)) > 0 {
		t.Errorf("Filter<FTYPE>Ptr failed.")
	}
}
func TestRemove<FTYPE>MethodChain(t *testing.T) {
	var v2 <TYPE> = 2
	var v3 <TYPE> = 3
	var v4 <TYPE> = 4
	isGreaterThanThree<FTYPE> := func (num <TYPE>) bool {
		return num > 3
	}
	expectedNewList := []<TYPE>{v2, v3}
	NewList := Make<FTYPE>Slice([]<TYPE>{v2, v3, v4}...).Remove(isGreaterThanThree<FTYPE>)
	if NewList[0] != expectedNewList[0] || NewList[1] != expectedNewList[1] {
		t.Errorf("Remove<FTYPE> failed. Expected New list=%v, actual list=%v", expectedNewList, NewList)
	}
}
func TestRemove2<FTYPE>MethodChain(t *testing.T) {
	if len(Make<FTYPE>Slice().Remove(nil)) > 0 {
		t.Errorf("Remove<FTYPE> failed.")
	}
}
func TestRemove<FTYPE>PtrMethodChain(t *testing.T) {
	var v2 <TYPE> = 2
	var v3 <TYPE> = 3
	var v4 <TYPE> = 4
	isGreaterThanThree<FTYPE> := func (num *<TYPE>) bool {
		return *num > 3
	}
	expectedNewList := []*<TYPE>{&v2, &v3}
	NewList := Make<FTYPE>SlicePtr([]*<TYPE>{&v2, &v3, &v4}...).RemovePtr(isGreaterThanThree<FTYPE>)
	if *NewList[0] != *expectedNewList[0] || *NewList[1] != *expectedNewList[1] {
		t.Errorf("Remove<FTYPE>Ptr failed. Expected New list=%v, actual list=%v", expectedNewList, NewList)
	}
}
func TestRemove2Ptr<FTYPE>MethodChain(t *testing.T) {
	if len(Make<FTYPE>SlicePtr().RemovePtr(nil)) > 0 {
		t.Errorf("Remove<FTYPE>Ptr failed.")
	}
}
func TestDropWhile<FTYPE>MethodChain(t *testing.T) {
	var v2 <TYPE> = 2
	var v3 <TYPE> = 3
	var v4 <TYPE> = 4
	var v5 <TYPE> = 5
	isEven<FTYPE> := func(num <TYPE>) bool {
		return num%2 == 0
	}
	expectedNewList := []<TYPE>{v3, v4, v5}
	NewList := Make<FTYPE>Slice([]<TYPE>{v4, v2, v3, v4, v5}...).DropWhile(isEven<FTYPE>)
	if NewList[0] != expectedNewList[0] || NewList[1] != expectedNewList[1] || NewList[2] != expectedNewList[2] {
		t.Errorf("DropWhile>MethodChain failed. Expected New list=%v, actual list=%v", expectedNewList, NewList)
	}
}
func TestDropWhile2<FTYPE>MethodChain(t *testing.T) {
	if len(Make<FTYPE>Slice().DropWhile(nil)) > 0 {
		t.Errorf("DropWhile<FTYPE> failed.")
	}
}
func TestDropWhile<FTYPE>PtrMethodChain(t *testing.T) {
	var v2 <TYPE> = 2
	var v3 <TYPE> = 3
	var v4 <TYPE> = 4
	var v5 <TYPE> = 5
	isEven<FTYPE>Ptr := func(num *<TYPE>) bool {
		return *num%2 == 0
	}
	expectedNewList := []*<TYPE>{&v3, &v4, &v5}
	NewList := Make<FTYPE>SlicePtr([]*<TYPE>{&v4, &v2, &v3, &v4, &v5}...).DropWhilePtr(isEven<FTYPE>Ptr)
	if *NewList[0] != *expectedNewList[0] || *NewList[1] != *expectedNewList[1] || *NewList[2] != *expectedNewList[2] {
		t.Errorf("DropWhile>PtrMethodChain failed. Expected New list=%v, actual list=%v", expectedNewList, NewList)
	}
}
func TestDropWhile2Ptr<FTYPE>MethodChain(t *testing.T) {
	if len(Make<FTYPE>SlicePtr().DropWhilePtr(nil)) > 0 {
		t.Errorf("DropWhile<FTYPE>Ptr failed.")
	}
}
func TestReverse<FTYPE>methodchain(t *testing.T) {
	var v1 <TYPE> = 1
	var v2 <TYPE> = 2
	var v3 <TYPE> = 3
	expected := []<TYPE>{v3, v2, v1}
	reversed :=  Make<FTYPE>Slice([]<TYPE>{v1, v2, v3}...).Reverse()
	if expected[0] != reversed[0] || expected[1] != reversed[1] || expected[2] != reversed[2] {
		t.Errorf("Reverse<Type>s failed")
	}
}
func TestReverse<FTYPE>Ptrmethodchain(t *testing.T) {
	var v1 <TYPE> = 1
	var v2 <TYPE> = 2
	var v3 <TYPE> = 3
	expected := []*<TYPE>{&v3, &v2, &v1}
	reversed :=  Make<FTYPE>SlicePtr([]*<TYPE>{&v1, &v2, &v3}...).ReversePtr()
	if *expected[0] != *reversed[0] || *expected[1] != *reversed[1] || *expected[2] != *reversed[2] {
		t.Errorf("Reverse<Type>sMethodChain failed")
	}
}
func TestDistinct<FTYPE>MethodChain(t *testing.T) {
	expected := []<TYPE>{8, 2, 0}
	list := []<TYPE>{8, 2, 8, 0, 2, 0}
	distinct := Make<FTYPE>Slice(list...).Distinct()
	if len(distinct) != 3 || distinct[0] != 8 || distinct[1] != 2 || distinct[2] != 0 {
		t.Errorf("DistinctInt failed. Expected=%v, actual=%v", expected, distinct)
	}
	expected = []<TYPE>{8, 2, 0}
	list = []<TYPE>{8, 2, 0}
	distinct = Make<FTYPE>Slice(list...).Distinct()
	if len(distinct) != 3 || distinct[0] != 8 || distinct[1] != 2 || distinct[2] != 0 {
		t.Errorf("DistinctInt failed. Expected=%v, actual=%v", expected, distinct)
	}
	expected = []<TYPE>{}
	list = []<TYPE>{}
	distinct = Make<FTYPE>Slice(list...).Distinct()
	if len(distinct) != 0 {
		t.Errorf("DistinctInt failed. Expected=%v, actual=%v", expected, distinct)
	}
	distinct = Make<FTYPE>Slice().Distinct()
	if len(distinct) != 0 {
		t.Errorf("DistinctInt failed. Expected=%v, actual=%v", expected, distinct)
	}
}
func TestDistinct<FTYPE>PtrMethodChain(t *testing.T) {
	var v8 <TYPE> = 8
	var v2 <TYPE> = 2
	var v0 <TYPE>
	expected := []*<TYPE>{&v8, &v2, &v0}
	list := []*<TYPE>{&v8, &v2, &v8, &v0, &v2, &v0}
	distinct := Make<FTYPE>SlicePtr(list...).DistinctPtr()
	if len(distinct) != 3 || *distinct[0] != v8 || *distinct[1] != v2 || *distinct[2] != v0 {
		t.Errorf("Distinct<FTYPE>Ptr failed. Expected=%v, actual=%v", expected, distinct)
	}
	expected = []*<TYPE>{&v8, &v2, &v0}
	list = []*<TYPE>{&v8, &v2, &v0}
	distinct = Make<FTYPE>SlicePtr(list...).DistinctPtr()
	if len(distinct) != 3 || *distinct[0] != v8 || *distinct[1] != v2 || *distinct[2] != v0 {
		t.Errorf("Distinct<TYPE>PtrMethodChain failed. Expected=%v, actual=%v", expected, distinct)
	}
	expected = []*<TYPE>{}
	list = []*<TYPE>{}
	distinct = Make<FTYPE>SlicePtr(list...).DistinctPtr()
	if len(distinct) != 0 {
		t.Errorf("Distinct<FTYPE>PtrMethodChain failed. Expected=%v, actual=%v", expected, distinct)
	}
	distinct = Make<FTYPE>SlicePtr().DistinctPtr()
	if len(distinct) != 0 {
		t.Errorf("Distinct<FTYPE>MethodChain failed. Expected=%v, actual=%v", expected, distinct)
	}
}
func TestTakeWhile<FTYPE>MethodChain(t *testing.T) {
	isEvenMethodChain := func(num <TYPE>) bool {
		return num%2 == 0
	}
	expectedNewList := []<TYPE>{4, 2, 4}
	NewList := Make<FTYPE>Slice([]<TYPE>{4, 2, 4, 7, 5}...).TakeWhile(isEvenMethodChain)
	if NewList[0] != expectedNewList[0] || NewList[1] != expectedNewList[1] || NewList[2] != expectedNewList[2] {
		t.Errorf("TakeWhileInt failed. Expected New list=%v, actual list=%v", expectedNewList, NewList)
	}
	if len(Make<FTYPE>Slice().TakeWhile(nil)) > 0 {
		t.Errorf("TakeWhileInt failed.")
	}
	if len(Make<FTYPE>Slice([]<TYPE>{}...).TakeWhile(nil)) > 0 {
		t.Errorf("TakeWhileInt failed.")
	}
}
func TestTakeWhile<FTYPE>MethodChainPtr(t *testing.T) {
	isEvenMethodChain := func(num *<TYPE>) bool {
		return *num%2 == 0
	}
	var v2 <TYPE> = 2
	var v4 <TYPE> = 4
	var v5 <TYPE> = 5
	var v7 <TYPE> = 7
	expectedNewList := []*<TYPE>{&v4, &v2, &v4}
	NewList := Make<FTYPE>SlicePtr([]*<TYPE>{&v4, &v2, &v4, &v7, &v5}...).TakeWhilePtr(isEvenMethodChain)
	if *NewList[0] != *expectedNewList[0] || *NewList[1] != *expectedNewList[1] || *NewList[2] != *expectedNewList[2] {
		t.Errorf("TakeWhile<FTYPE>methodchain failed. Expected New list=%v, actual list=%v", expectedNewList, NewList)
	}
	if len(Make<FTYPE>SlicePtr().TakeWhilePtr(nil)) > 0 {
		t.Errorf("TakeWhile<FTYPE> failed.")
	}
	if len(Make<FTYPE>SlicePtr([]*<TYPE>{}...).TakeWhilePtr(nil)) > 0 {
		t.Errorf("TakeWhile<FTYPE> failed.")
	}
}
`
}