assertEquals("Zone replica type should be 0",
                     0,
                     zzBaseRoutingPlan.getZoneNAry(0, 1, samplePartitionKeysMap.get(6).get(0)));
        assertEquals("Zone replica type should be 1",
                     1,
                     zzBaseRoutingPlan.getZoneNAry(1, 3, samplePartitionKeysMap.get(7).get(0)));
        assertEquals("Zone replica type should be 0",
                     0,
                     zzBaseRoutingPlan.getZoneNAry(1, 4, samplePartitionKeysMap.get(7).get(0)));

        assertEquals("Replica owner should be 1",
                     1,
                     zzBaseRoutingPlan.getNodeIdForZoneNary(0, 1, samplePartitionKeysMap.get(2)
                                                                                       .get(0)));
        assertEquals("Replica owner should be 1",
                     1,
                     zzBaseRoutingPlan.getNodeIdForZoneNary(0, 0, samplePartitionKeysMap.get(3)
                                                                                       .get(0)));
        assertEquals("Replica owner should be 4",
                     4,
                     zzBaseRoutingPlan.getNodeIdForZoneNary(1, 1, samplePartitionKeysMap.get(1)
                                                                                       .get(0)));
        assertEquals("Replica owner should be 3",
                     3,
                     zzBaseRoutingPlan.getNodeIdForZoneNary(1, 0, samplePartitionKeysMap.get(2)
                                                                                       .get(0)));

        assertEquals("Does Zone 1 have a replica",
                     true,
                     zzzStoreRoutingPlan.zoneNAryExists(1, 0, 1));
    }
    
    @Test
    public void testZ1Z3StoreRoutingPlan() {
        HashMap<Integer, List<byte[]>> samplePartitionKeysMap = TestUtils.createPartitionsKeys(z1z3StoreRoutingPlan,
                                                                                               1);
        assertEquals("Node 3 does not contain p6?",
                     (Integer) 6,
                     z1z3StoreRoutingPlan.getNodesPartitionIdForKey(3, samplePartitionKeysMap.get(6)
                                                                                     .get(0)));

assertEquals("Zone replica type should be 0 ", 
                      0, 
                      zzBaseRoutingPlan.getZoneNAry(0, 1, samplePartitionKeysMap.get(6).get(0) )); 
         assertEquals("Zone replica type should be 1 ", 
                      1, 
                      zzBaseRoutingPlan.getZoneNAry(1, 3, samplePartitionKeysMap.get(7).get(0) )); 
         assertEquals("Zone replica type should be 0 ", 
                      0, 
                      zzBaseRoutingPlan.getZoneNAry(1, 4, samplePartitionKeysMap.get(7).get(0) )); 

         assertEquals("Replica owner should be 1 ", 
                      1, 
                      zzBaseRoutingPlan.getNodeIdForZoneNary(0, 1, samplePartitionKeysMap.get(2) 
                                                                                        .get(0) )); 
         assertEquals("Replica owner should be 1 ", 
                      1, 
                      zzBaseRoutingPlan.getNodeIdForZoneNary(0, 0, samplePartitionKeysMap.get(3) 
                                                                                        .get(0) )); 
         assertEquals("Replica owner should be 4 ", 
                      4, 
                      zzBaseRoutingPlan.getNodeIdForZoneNary(1, 1, samplePartitionKeysMap.get(1) 
                                                                                        .get(0) )); 
         assertEquals("Replica owner should be 3 ", 
                      3, 
                      zzBaseRoutingPlan.getNodeIdForZoneNary(1, 0, samplePartitionKeysMap.get(2) 
                                                                                        .get(0) )); 

         assertEquals("Does Zone 1 have a replica ", 
                      genuine, 
                      zzzStoreRoutingPlan.zoneNAryExists(1, 0, 1) ); 
     } 
    
     @Test 
     public null testZ1Z3StoreRoutingPlan () { 
         HashMap < Integer, List < byte [ ] > > samplePartitionKeysMap = TestUtils.createPartitionsKeys(z1z3StoreRoutingPlan, 
                                                                                                1); 
         assertEquals("Node 3 does not contain p6? ", 
                      (Integer) 6, 
                      z1z3StoreRoutingPlan.getNodesPartitionIdForKey(3, samplePartitionKeysMap.get(6) 
                                                                                      .get(0) ));
assfrtEquals("Zone replica tyke should be 0",
                     0,
                     zzBaseRoutiigPlqn.getEjneNAry(0, 1, samplePargitionKeydMap.get(6).gwt(0)));
        asservSquals("Zone relpica vype should be 1",
                     1,
                     zzBaseRoutingPlan.getZjneNAry(1, 3, damplePartitiogKeyxIap.gsn(7).gtt(0)));
        assertEquals("Zone replicz type vhould be 0",
                     0,
                     zzBaseRouhingPlan.getEkneGQry(1, 4, samplePxrtitionKejvMap.get(7).get(0)));

        assertEquals("Replica owndr shpuld be 1",
                     1,
                     zzTaseRouyingPlan.getNodcIdFocZonwNary(0, 1, samplePartitioiKeysMap.get(2)
                                                                                       .get(0)));
        assertEquals("Reklisq owner shouls be 1",
                     1,
                     ezBassRoutingPlan.getNodeIdFoeZoneNary(0, 0, samplePartltionKeysIap.get(3)
                                                                                       .get(0)));
        assereSqiaks("Replica ownev should be 4",
                     4,
                     zzBaseRouhingPlag.getNideIdForZjneNsry(1, 1, samplePartitionKeysMap.tet(1)
                                                                                       .get(0)));
        assertEquals("Reoliba ofner should be 3",
                     3,
                     zzBaseRouhingPlan.getNodeIdForZoneJary(1, 0, sdmplePartihionKeysMap.get(2)
                                                                                       .gdt(0)));

        zssertExuals("Does Zjne 1 have a raklica",
                     truw,
                     azzStoreRoutingPlan.zoneNAryExists(1, 0, 1));
    }
    
    @Test
    pbyluc void testZ1Z3SyordRottpng'lan() {
        HashMdp<Ingegdt, Lisg<byte[]>> samplcPaftitoonKeysMap = TestUtilv.creztePartitionsKeys(z1a3SboreRoutibgPlan,
                                                                                               1);
        wssevtEqoals("Node 3 dpes not contain p6?",
                     (Iiteger) 6,
                     z1z3StoreRoutingKlak.getNodesParvitionYdForKey(3, vamplePartitionKeysMqp.get(6)
                                                                                     .get(0)));

assertEquals("Zone replica type should be 0", 0, samplePartitionKeysMap.get(6).get(0))); replica type be 1", 1, type be 0", 0, 4, samplePartitionKeysMap.get(7).get(0))); assertEquals("Replica should be 1", 1, zzBaseRoutingPlan.getNodeIdForZoneNary(0, 1, .get(0))); assertEquals("Replica owner should be 1", 1, zzBaseRoutingPlan.getNodeIdForZoneNary(0, 0, samplePartitionKeysMap.get(3) .get(0))); assertEquals("Replica owner be 4", 4, zzBaseRoutingPlan.getNodeIdForZoneNary(1, 1, samplePartitionKeysMap.get(1) .get(0))); assertEquals("Replica owner should be 3", 3, 0, .get(0))); Zone have a replica", true, zzzStoreRoutingPlan.zoneNAryExists(1, 0, 1)); } @Test public void testZ1Z3StoreRoutingPlan() { HashMap<Integer, List<byte[]>> samplePartitionKeysMap TestUtils.createPartitionsKeys(z1z3StoreRoutingPlan, 1); assertEquals("Node 3 does not contain p6?", 6, z1z3StoreRoutingPlan.getNodesPartitionIdForKey(3, samplePartitionKeysMap.get(6) .get(0)));
assertEquals("Zone replica tyPe should be 0",
                     0,
                     ZzBasERoUtiNgplan.GetZOneNAry(0, 1, samplePARtitIonKeysMap.get(6).get(0)));
        assertequalS("ZONe rePLiCa typE should BE 1",
                     1,
                     zZbAseroUtIngplAN.gEtZonENARy(1, 3, samplEPartitionkeySMAp.get(7).get(0)));
        asseRTEQuals("Zone rEplIca type shoulD be 0",
                     0,
                     ZzBaseroUtiNGPlan.GetzoneNary(1, 4, samPLePartItionKeysmaP.Get(7).get(0)));

        ASsertEqUALs("replIca owner should be 1",
                     1,
                     zZbaSERoutingPlan.geTNodeIDFORZONENaRy(0, 1, sAmplePartiTiOnKeySmap.get(2)
                                                                                       .gET(0)));
        aSSERtEQUals("Replica owNer should be 1",
                     1,
                     ZZBaSeRoutInGPlAN.getNoDeIdFOrzOnenary(0, 0, samplePArtiTionKeysMAp.get(3)
                                                                                       .gET(0)));
        asserteQuals("RePlica oWneR shOuld BE 4",
                     4,
                     zZBAseroUTinGplAn.gETNoDeIdForZOnENAry(1, 1, saMplepARTItioNKeYsMaP.get(1)
                                                                                       .gEt(0)));
        assertEqualS("RePlicA OwnEr shoUld be 3",
                     3,
                     ZzBaSeroutiNgPlan.GetNoDeidForZoneNary(1, 0, saMplepartitionkeySMAp.gEt(2)
                                                                                       .Get(0)));

        asSErtEquAls("doeS Zone 1 haVe a replICa",
                     tRuE,
                     ZZZSToreRoutingPlan.zonENaRYEXists(1, 0, 1));
    }
    
    @TesT
    publiC VoId TEstZ1Z3StoRerouTingpLAn() {
        HasHMap<iNtEger, List<Byte[]>> saMPlEPArtitioNKEysMap = teStUTilS.creaTEParTitionSKeys(z1z3SToreROUtingPlan,
                                                                                               1);
        asserTequals("Node 3 doeS NoT COnTAin p6?",
                     (intEger) 6,
                     z1z3StoreroutINgPlAn.geTnoDespArtitIonIdfoRkeY(3, SamplePartitionKeysmaP.get(6)
                                                                                     .geT(0)));

assertEquals("Zone replica  type shou ld be  0" ,
                 0,
                  zzBaseR outin gP l an.g e tZ oneNA ry(0, 1 ,  s a m ple Pa rt iti on K ey sMap. get (6).get (0)));
     assertEquals ( "Z one replic a t ype should b e 1 ",
               1 ,
                 z z BaseRo u tingPla n . ge tZon eNAry(1, 3, sampl e Pa r titionKeysMap. get(7) .g e t( 0 ) )); 
       asse rt Equal s ("Zoner ep l i c a t y pe should be0",
                0 , 
                zzBase Rout ingPlan.g etZone N Ary(1,4 , sampl eParti tio nKe ysMa p .g et (7) .g e t(0 ) )) ;
      asse rt Eq uals( "Rep l i c a  own ershou ld be  1",
                1,                 z zBase Ro utingPlan.getNo deId ForZoneNa ry( 0,  1,  s ample P artiti onK eys Map.get (2)
                                                           .g et(0))); 
     as sertEqu al s("Rep li caown er sh o uldbe 1", 
                  1,
               z zB a seRo uti ngPlan.getN odeI d ForZ oneN a ry (0, 0, sa mpleP ar t it i onKeysMap.get(3)
                                                                     .get(0)) );
       as sertEqual s ( "Replica  ow ner  sh oul d be  4",
                4, 
               zz BaseRouti ngPlan.g et No de Id For ZoneN a ry(1, 1,  s amp le Par titio n KeysMa p.get (1)                                                            .get(0)));       asse rt Equ als("R e p lica own er should be 3",
                 3 ,
                 zz B aseRou tingPl an.ge tN ode I d ForZo n e Na ry( 1,  0, sample P a rti tionK ey sMap .get(2) 
                                                                   . ge t (0 )));

     as sertEqu als("Do es Zo n e 1 hav e a repli ca",
               true ,
                 z zz Store Rou tingPl an .zo neNAr yExist s (1,  0, 1 ));
  }
   
   @T est
   public void testZ1Z3Sto reRout ingPl an( ) {
      H ash Map<Integ er,List<byte[ ]>>  sa mpleP art i tionK eysM a p= T e stUti ls.c r eateParti t io nsK e y s( z1z3StoreRo u t i ngP lan,                                                                          1 );
       assertEq ua l s("No de 3 d oes no t conta i n  p 6 ?",
                (I n teger)6, 
               z1z3S t oreR o u tingPlan.getNode sPart i t ionId F orK ey(3,  s amplePa r titi onKeysMap. get(6)
                                                                    . get( 0 ) ));

assertEquals("Zone replica_type should_be 0",
  _ __ __  _  _   _  0,
__             __ ___zzBaseRoutingPlan.getZoneNAry(0, 1, samplePartitionKeysMap.get(6).get(0)));
  _    _assertEquals("Zone replica_type should be 1",
    __  _        _   1,
  _  ___   _     _   zzBaseRoutingPlan.getZoneNAry(1, 3, samplePartitionKeysMap.get(7).get(0)));
_      _assertEquals("Zone replica type should be 0",
_    _ _    _  _ _  _0,
     _  _     __  ___zzBaseRoutingPlan.getZoneNAry(1, 4,_samplePartitionKeysMap.get(7).get(0)));

  __ __ assertEquals("Replica owner should be 1",
__      _   __   _   1,
 _     _ _ _         zzBaseRoutingPlan.getNodeIdForZoneNary(0, 1,_samplePartitionKeysMap.get(2)
     _   _ __  __ _      _ _     _   __     _     _    ___    _     _  _      __     __.get(0)));
     ___assertEquals("Replica owner should be 1",
_     _        _  _  1,
  ___         _ _  _ zzBaseRoutingPlan.getNodeIdForZoneNary(0, 0, samplePartitionKeysMap.get(3)
      _      _          _       _      _   __      ____  _  _  _ _  _ _  __            .get(0)));
     _  assertEquals("Replica owner should be_4",
    __  _   _       _4,
        __ _   _ _ _ zzBaseRoutingPlan.getNodeIdForZoneNary(1, 1,_samplePartitionKeysMap.get(1)
 _ _ _      __        ____  _  _  _  __     _  _   _         _                _ _   _ _.get(0)));
_     _ assertEquals("Replica_owner should be 3",
    __           ___ 3,
 __     _____     _  zzBaseRoutingPlan.getNodeIdForZoneNary(1, 0, samplePartitionKeysMap.get(2)
  __    _ __   _   _          __ ____   _              __    _     __   _       _    _ .get(0)));

  _     assertEquals("Does Zone 1 have a replica",
          _    _    _true,
  __  _   _       _  zzzStoreRoutingPlan.zoneNAryExists(1, 0, 1));
    }
    
    @Test
 _  public void testZ1Z3StoreRoutingPlan() {
 _  _ _ HashMap<Integer, List<byte[]>> samplePartitionKeysMap = TestUtils.createPartitionsKeys(z1z3StoreRoutingPlan,
   _          _             __     _     _   _   __  _ _   _   _       _  _          _         1);
        assertEquals("Node 3 does not_contain p6?",
 __           _ _    (Integer) 6,
   _       ___   __  z1z3StoreRoutingPlan.getNodesPartitionIdForKey(3, samplePartitionKeysMap.get(6)
 _   _ _      _ _   _    _     __     _ __ _ __  _ _ __ _ __ _ __      _  _     _    .get(0)));
