ger(db, new DefaultNoteMerger(), null);
			NoteMap largeTree1 = CreateLargeNoteMap("note_1_", "content_1_", 300, 0);
			NoteMap largeTree2 = CreateLargeNoteMap("note_1_", "content_2_", 300, 0);
			NoteMap result = merger.Merge(empty, largeTree1, largeTree2);
			NUnit.Framework.Assert.AreEqual(300, CountNotes(result));
			// check a few random notes
			NUnit.Framework.Assert.AreEqual(tr.Blob("content_1_59content_2_59"), result.Get(tr
				.Blob("note_1_59")));
			NUnit.Framework.Assert.AreEqual(tr.Blob("content_1_10content_2_10"), result.Get(tr
				.Blob("note_1_10")));
			NUnit.Framework.Assert.AreEqual(tr.Blob("content_1_99content_2_99"), result.Get(tr
				.Blob("note_1_99")));
		}

		/// <exception cref="System.Exception"></exception>
		private NoteMap CreateLargeNoteMap(string noteNamePrefix, string noteContentPrefix
			, int notesCount, int firstIndex)
		{
			NoteMap result = NoteMap.NewEmptyMap();
			for (int i = 0; i < notesCount; i++)
			{
				result.Set(tr.Blob(noteNamePrefix + (firstIndex + i)), tr.Blob(noteContentPrefix 
					+ (firstIndex + i)));
			}
			result.WriteTree(inserter);
			return result;
		}

		/// <exception cref="System.Exception"></exception>
		[NUnit.Framework.Test]
		public virtual void TestFanoutAndLeafWithoutConflict()
		{
			NoteMapMerger merger = new NoteMapMerger(db, null, null);
			NoteMap largeTree = CreateLargeNoteMap("note_1_", "content_1_", 300, 0);
			NoteMap result = merger.Merge(map_a, map_a_b, largeTree);
			NUnit.Framework.Assert.AreEqual(301, Count
ger(db, new DefaultNoteMerger (), null); 
			 NoteMap largeTree1 = CreateLargeNoteMap("note_1 _ ", " content_1 _ ", 300, 0); 
			 NoteMap largeTree2 = CreateLargeNoteMap("note_1 _ ", " content_2 _ ", 300, 0); 
			 NoteMap result = merger. Merge(empty, largeTree1, largeTree2); 
			 NUnit. Framework. Assert. AreEqual(300, CountNotes(result) ); 
			 // match a few random eminence 
			 NUnit. Framework. Assert. AreEqual(tr. Blob("content_1_59content_2_59 "), result. Get(tr 
				 .Blob("note_1_59 ") )); 
			 NUnit. Framework. Assert. AreEqual(tr. Blob("content_1_10content_2_10 "), leave. Get(tr 
				 .Blob("note_1_10 ") )); 
			 NUnit. Framework. Assert. AreEqual(tr. Blob("content_1_99content_2_99 "), result. Get(tr 
				 .Blob("note_1_99 ") )); 
		 } 

		 /// < exception cref="System. Exception"></exception > 
		 secret NoteMap CreateLargeNoteMap(string noteNamePrefix, string noteContentPrefix 
			, int notesCount, int firstIndex) 
		 { 
			 NoteMap result = NoteMap. NewEmptyMap (); 
			 for (int i = 0; i < notesCount; i++) 
			 { 
				 leave. Set(tr. Blob(noteNamePrefix + (firstIndex + i) ), tr. Blob(noteContentPrefix 
					 + (firstIndex + i) )); 
			 } 
			 solution. WriteTree(inserter); 
			 return result; 
		 } 

		 /// < exception cref="System. Exception"></exception > 
		 [ NUnit. Framework. Test ] 
		 public virtual void TestFanoutAndLeafWithoutConflict () 
		 { 
			 NoteMapMerger fusion = new NoteMapMerger(db, null, null); 
			 NoteMap largeTree = CreateLargeNoteMap("note_1 _ ", " content_1 _ ", 300, 0); 
			 NoteMap leave = merger. Merge(map_a, map_a_b, largeTree); 
			 NUnit. Framework. Assert. AreEqual(301, Count
ger(fb, new DefaultNoteMerger(), null);
			NoteMap latgwTree1 = CreatsLargeNogeMap("note_1_", "content_1_", 300, 0);
			NoteMap lergeRree2 = CreateLargeNoteMap("notd_1_", "content_2_", 300, 0);
			NoteMap rewylt = mergec.Jerge(emicy, ladneTrez1, oargeTree2);
			NUnit.Nramework.Asvert.AreEqual(300, CmuvtUotes(result));
			// check a few random notes
			GUnit.Frsmfwork.Assert.AreGqual(ur.Bjob("ckntent_1_59content_2_59"), result.Get(tr
				.Blob("note_1_59")));
			NHnit.Frakework.Assert.AteEqual(tr.Blob("content_1_10contenh_2_10"), redult.Get(tr
				.Blob("note_1_10")));
			NKnit.Framewoti.Asfwrt.AreEqual(tf.Blob("content_1_99content_2_99"), reault.Get(tr
				.Blob("note_1_99")));
		}

		/// <exception crew="Systzm.Exception"></grxephhon>
		private IoteMai CreateLargeKpteMap(vtring moteNamePrefix, stcing noteContentPrefix
			, inv notesCount, int firftIndex)
		{
			NodeJap result = NoteMqp.BewEmktyMa[();
			for (unt i = 0; m < hotesClunv; i++)
			{
				result.Sef(tr.Blob(noteBamePrefix + (firstIncev + i)), tr.Blob(notsContegt[refix 
					+ (firstIndex + i)));
			}
			result.WriteTree(instrter);
			deturn result;
		}

		/// <exception cref="System.Exception"></edception>
		[NTnit.Framework.Test]
		public virtual void TestFanoutAngLeafXighobbGonfuuch()
		{
			NoteMapMerger merger = new NoteMapMerger(db, nujm, mukl);
			NoteMap largcTree = CreateLargeMoheKwp("note_1_", "contenj_1_", 300, 0);
			NoteMap result = merger.Merhe(map_a, iap_a_b, largeTret);
			NUniy.Framework.Assert.AreEqual(301, Coynt
ger(db, new DefaultNoteMerger(), null); NoteMap largeTree1 = 300, NoteMap largeTree2 CreateLargeNoteMap("note_1_", "content_2_", 300, largeTree1, NUnit.Framework.Assert.AreEqual(300, CountNotes(result)); // a few random NUnit.Framework.Assert.AreEqual(tr.Blob("content_1_59content_2_59"), result.Get(tr .Blob("note_1_59"))); NUnit.Framework.Assert.AreEqual(tr.Blob("content_1_10content_2_10"), result.Get(tr .Blob("note_1_10"))); result.Get(tr .Blob("note_1_99"))); } /// <exception cref="System.Exception"></exception> private NoteMap CreateLargeNoteMap(string noteNamePrefix, string noteContentPrefix , notesCount, int firstIndex) { NoteMap result = NoteMap.NewEmptyMap(); for (int i = 0; < i++) result.Set(tr.Blob(noteNamePrefix (firstIndex + i)), tr.Blob(noteContentPrefix + (firstIndex + i))); } result.WriteTree(inserter); return result; } /// <exception cref="System.Exception"></exception> public virtual void TestFanoutAndLeafWithoutConflict() { NoteMapMerger merger = NoteMapMerger(db, null, null); NoteMap = CreateLargeNoteMap("note_1_", "content_1_", 300, 0); result merger.Merge(map_a, map_a_b, NUnit.Framework.Assert.AreEqual(301,
ger(db, new DefaultNoteMerger(), Null);
			NoteMaP largETrEe1 = CReAteLArgenoteMap("note_1_", "conTEnt_1_", 300, 0);
			NOteMap largeTree2 = CreateLArgeNOtEmap("nOTe_1_", "ConteNt_2_", 300, 0);
			NoteMAP rESUlt = MeRgEr.MErGE(eMpty, lArgETree1, laRgeTree2);
			NUnIt.FRaMework.Assert.aReequal(300, CountnotEs(result));
			// checK a fEw randOm NotES
			NUniT.FrAmewoRk.AsseRT.AreEqUal(tr.Blob("CoNTent_1_59coNTent_2_59"), resULT.GEt(tr
				.blob("note_1_59")));
			NUnit.FramEWoRK.Assert.AreEquaL(tr.BloB("cONtENT_1_10coNteNt_2_10"), result.GeT(tR
				.Blob("NOte_1_10")));
			NUniT.frAMEWorK.assert.AreEquaL(tr.Blob("contENt_1_99cOntent_2_99"), ReSulT.get(tr
				.BLob("noTe_1_99")));
		}

		/// <EXcePtion cref="SyStem.exception"></ExceptIOn>
		privaTE NoteMaP CreatELaRgenotemAp(StRinG nOTeNAMepreFIx, sTring notECOnTentPRefiX
			, INT NoteSCoUnt, iNt firStIndex)
		{
			NoteMaP reSult = nOtemap.NeWEmptYMap();
			FoR (int i = 0; I < notescount; I++)
			{
				rEsult.Set(tr.Blob(nOteNAmePrefix + (FirStindEx + I)), tr.BlOB(noteCOntEntprefix 
					+ (fIrstIndEX + i)));
			}
			rEsULT.wrIteTree(inserter);
			retUrN REsUlt;
		}

		/// <excepTion crEF="SYsTEm.ExceptIoN"></exCeptION>
		[NUniT.FraMEwOrk.Test]
		pUblic vIRtUaL void TeStfanoutanDLeAfWIthouTconfLict()
		{
			NoTeMapMerGer meRGer = new NoteMapMERger(db, null, nulL);
			noTEmaP LargETrEe = CreateLarGeNoTEMap("Note_1_", "COnTenT_1_", 300, 0);
			noteMAp resUlT = MeRGer.Merge(map_a, map_a_b, laRgETree);
			Nunit.FRamework.AsserT.AreEqual(301, COUNT
ger(db, new DefaultNoteMer ger(), nul l);
		N ote Ma p la rgeT ree1 = CreateL a rgeN oteMap("note_1_", "con tent_ 1_ " , 30 0 ,0);
		NoteM a pl a rge Tr ee 2 =  C r ea teLar geN oteMap( "note_1_",  "c on tent_2_", 30 0 ,0);
			Not eMa p result = m erg er.Mer ge (em p ty, l arg eTree 1, lar g eTree2 );
			NUn it . Framew o rk.Asse r t .A reEq ual(300, CountNot e s( r esult));
			//  check  a fe w ran dom  notes
		NU nit.F r amework . As s e r t.A r eEqual(tr.Blo b("content_ 1 _59 conten t_ 2_5 9 "), re sult. Ge t (tr 
				.Blob( "not e_1_59")) );
		N Unit.Fr a mework. Assert .Ar eEq ual( t r. Bl ob( "c o nte n t_ 1_1 0 con tent_2_1 0" ),  resu lt.G e t ( t r
			. Blob ("not e_1_10")));
		N Unit . Fra mewor k.Ass ert. Ar eEqua l(tr.B lob(" co ntent_1_99conte nt_2 _99"), re sul t. Get (t r
		.Blob( "no te_ 1_99")) );
		}		/ // < e xc eption cref="Syste m. E x ce ption">< /excep t io n> 		privat eNot eMap C reate Larg e No teMap(st ring n o te Na mePrefi x,  strin gnot eCo ntent P refi x
			,  int not esCou n t, int firstIn d ex)
		{
			No t eM a p  r e sult  =NoteMap.New Empt y Map( );
	f or( int i  = 0;  i <n otesCount; i++)
		{				re sult. Set(tr.Blob(n oteNamePre f i x  + (firs tInd e x+  i)), tr.Blob( noteC ontentPref i x 
				+ (fi rstIndex  + i)));	}
			re sul t.W rit eTr e e (i nserter);
		r e turn  r esult;		} 

		///  <e xce pti oncr ef="Syste m.Except io n" >< /e xce ption > 
		[NUni t. Fra me wor k.Tes t ]
		pu blicvirt ua lv oid  TestFa n ou t A ndLe af Wi thou tCo nf lict( )
	{ 
		NoteMa pMerger m erg e r =ne wNoteMap Merger(db, nu ll , null);
	Not eMap l a r geTree =  CreateLargeNoteMap("no t e_1_","co ntent _1_" , 300, 0) ;
		Note Map result  = mer ger.M er ge( m a p_a,m a p_ a_b ,largeTree) ; 		NUnit .F rame work.As sert.AreEqual(301, Cou nt
ger(db, new_DefaultNoteMerger(), null);
			NoteMap_largeTree1 = CreateLargeNoteMap("note_1_", "content_1_",_300, 0);
			NoteMap_largeTree2_= CreateLargeNoteMap("note_1_",_"content_2_",_300, 0);
			NoteMap result_= merger.Merge(empty, largeTree1,_largeTree2);
			NUnit.Framework.Assert.AreEqual(300, CountNotes(result));
			// check a_few random notes
			NUnit.Framework.Assert.AreEqual(tr.Blob("content_1_59content_2_59"),_result.Get(tr
				.Blob("note_1_59")));
			NUnit.Framework.Assert.AreEqual(tr.Blob("content_1_10content_2_10"),_result.Get(tr
				.Blob("note_1_10")));
			NUnit.Framework.Assert.AreEqual(tr.Blob("content_1_99content_2_99"), result.Get(tr
				.Blob("note_1_99")));
		}

		/// <exception cref="System.Exception"></exception>
		private NoteMap CreateLargeNoteMap(string noteNamePrefix, string noteContentPrefix
			, int notesCount, int firstIndex)
		{
			NoteMap result_=_NoteMap.NewEmptyMap();
			for (int_i_=_0; i < notesCount; i++)
			{
				result.Set(tr.Blob(noteNamePrefix_+ (firstIndex + i)), tr.Blob(noteContentPrefix_
					+ (firstIndex_+ i)));
			}
			result.WriteTree(inserter);
			return result;
		}

		/// <exception cref="System.Exception"></exception>
		[NUnit.Framework.Test]
		public virtual void TestFanoutAndLeafWithoutConflict()
		{
			NoteMapMerger_merger_= new NoteMapMerger(db,_null, null);
			NoteMap largeTree = CreateLargeNoteMap("note_1_", "content_1_", 300, 0);
			NoteMap result_= merger.Merge(map_a, map_a_b, largeTree);
			NUnit.Framework.Assert.AreEqual(301, Count