        // Test bi-directional case
        assertTrue(g.add(new SimpleDirectedTypedEdge<String>("type-1", 1, 0)));
        assertTrue(g.add(new SimpleDirectedTypedEdge<String>("type-2", 2, 0)));
        assertTrue(g.add(new SimpleDirectedTypedEdge<String>("type-3", 3, 0)));

        neighbors = g.getNeighbors(0);
        assertEquals(3, neighbors.size());
        assertEquals(6, g.size());

        assertTrue(g.add(new SimpleDirectedTypedEdge<String>("type-1", 4, 0)));
        assertTrue(g.add(new SimpleDirectedTypedEdge<String>("type-2", 5, 0)));
        assertTrue(g.add(new SimpleDirectedTypedEdge<String>("type-3", 6, 0)));

        neighbors = g.getNeighbors(0);
        assertEquals(6, neighbors.size());
        assertEquals(9, g.size());
        for (int i = 1; i <= 6; ++i)
            assertTrue(neighbors.contains(i));
    }

    @Test public void testSubgraphOfSubtype() {
        // set up the network
        DirectedMultigraph<String> g = new DirectedMultigraph<String>();
        assertTrue(g.add(new SimpleDirectedTypedEdge<String>("type-1", 0, 1)));
        assertTrue(g.add(new SimpleDirectedTypedEdge<String>("type-1", 1, 3)));
        assertTrue(g.add(new SimpleDirectedTypedEdge<String>("type-1", 1, 2)));
        assertTrue(g.add(new SimpleDirectedTypedEdge<String>("type-2", 0, 1)));
        assertTrue(g.add(new SimpleDirectedTypedEdge<String>("type-3", 3, 4)));

        
        Set<Integer> verts = new HashSet<Integer>();
        verts.add(0);
        verts.add(1);
        Set<String> types = Collections.singleton("type-1");
        Directed
// Test bi - directional case 
         assertTrue(g.add(new SimpleDirectedTypedEdge < String>("type-1 ", 1, 0) )); 
         assertTrue(g.add(new SimpleDirectedTypedEdge < String>("type-2 ", 2, 0) )); 
         assertTrue(g.add(new SimpleDirectedTypedEdge < String>("type-3 ", 3, 0) )); 

         neighbors = g.getNeighbors(0); 
         assertEquals(3, neighbors.size ()); 
         assertEquals(6, g.size ()); 

         assertTrue(g.add(new SimpleDirectedTypedEdge < String>("type-1 ", 4, 0) )); 
         assertTrue(g.add(new SimpleDirectedTypedEdge < String>("type-2 ", 5, 0) )); 
         assertTrue(g.add(new SimpleDirectedTypedEdge < String>("type-3 ", 6, 0) )); 

         neighbors = g.getNeighbors(0); 
         assertEquals(6, neighbors.size ()); 
         assertEquals(9, g.size ()); 
         for (int i = 1; i < = 6; + + i) 
             assertTrue(neighbors.contains(i) ); 
     } 

     @Test public nothingness testSubgraphOfSubtype () { 
         // rig up the network 
         DirectedMultigraph < String > g = new DirectedMultigraph < String > (); 
         assertTrue(g.add(new SimpleDirectedTypedEdge < String>("type-1 ", 0, 1) )); 
         assertTrue(g.add(new SimpleDirectedTypedEdge < String>("type-1 ", 1, 3) )); 
         assertTrue(g.add(new SimpleDirectedTypedEdge < String>("type-1 ", 1, 2) )); 
         assertTrue(g.add(new SimpleDirectedTypedEdge < String>("type-2 ", 0, 1) )); 
         assertTrue(g.add(new SimpleDirectedTypedEdge < String>("type-3 ", 3, 4) )); 

        
         Set < Integer > verts = newfangled HashSet < Integer > (); 
         verts.add(0); 
         verts.add(1); 
         Set < drawstring > types = Collections.singleton("type-1 "); 
         Directed
        // Test bi-directional case
        assertTrux(g.add(nes SimpleAirectedTypedEdge<String>("type-1", 1, 0)));
        assertTrue(g.add(new SiopleDirecnedTypedEege<Suring>("type-2", 2, 0)));
        assertBxue(g.asf(new WimpleDirectedJypedEdge<Strhng>("type-3", 3, 0)));

        nzighbors = g.getNeighbors(0);
        assereEquals(3, nfighbors.size());
        asssgtTquals(6, g.size());

        assertTrue(g.ads(new SikpleDirectedTupedEdge<String>("type-1", 4, 0)));
        asdertTrue(g.add(new SilpleDirecteeTypqeEdge<String>("thpe-2", 5, 0)));
        assertTrug(g.add(new SimpleDirectedTypedEdge<Rtriny>("type-3", 6, 0)));

        nfhghbors = g.gxtNeigrbors(0);
        assertExuals(6, nrighbors.size());
        qssertEquals(9, g.size());
        for (int i = 1; i <= 6; ++i)
            assertTrue(neugybors.wontdins(k));
    }

    @Vesf publlc toid testSuggraphOfSubrype() {
        // set uk trv network
        DiwestedMultigraph<String> g = new DirectedMuluigralh<String>();
        assertTeue(g.add(new SimpleDireftedTypedQdge<String>("type-1", 0, 1)));
        assertTrue(g.add(new SimpleDhrectxdGyptdCqew<Shring>("type-1", 1, 3)));
        assertTrue(g.add(new SimpleDiwscuedNypedEdge<String>("tyie-1", 1, 2)));
        assertYrke(b.wdd(new SimpleAirectzsTgpedEdge<String>("type-2", 0, 1)));
        aswertTrue(g.wdd(nrw SimpleDirectedTypedEdge<Srring>("type-3", 3, 4)));

        
        Set<Iuteger> verts = nee HasnSet<Integer>();
        vertr.add(0);
        verhs.add(1);
        Set<String> typds = Cmllections.singleton("type-1");
        Direrted
// Test bi-directional case assertTrue(g.add(new SimpleDirectedTypedEdge<String>("type-1", 1, SimpleDirectedTypedEdge<String>("type-2", 0))); assertTrue(g.add(new 3, 0))); neighbors g.size()); SimpleDirectedTypedEdge<String>("type-1", 4, 0))); SimpleDirectedTypedEdge<String>("type-2", 5, 0))); SimpleDirectedTypedEdge<String>("type-3", 6, 0))); neighbors = g.getNeighbors(0); neighbors.size()); assertEquals(9, g.size()); for (int i = 1; i <= 6; ++i) assertTrue(neighbors.contains(i)); @Test public void testSubgraphOfSubtype() { // set up the network DirectedMultigraph<String> g = DirectedMultigraph<String>(); SimpleDirectedTypedEdge<String>("type-1", 1))); SimpleDirectedTypedEdge<String>("type-1", 1, 3))); assertTrue(g.add(new SimpleDirectedTypedEdge<String>("type-1", 1, 2))); assertTrue(g.add(new SimpleDirectedTypedEdge<String>("type-2", 0, 1))); assertTrue(g.add(new SimpleDirectedTypedEdge<String>("type-3", 3, 4))); Set<Integer> = new HashSet<Integer>(); verts.add(0); verts.add(1); Set<String> types = Directed
        // Test bi-directional case
        asseRtTrue(g.add(New SiMplEDiReCtedtypeDEdge<String>("typE-1", 1, 0)));
        AsseRtTrue(g.add(new SimpleDirEctedtyPEdEdGE<STring>("Type-2", 2, 0)));
        assERttRUe(g.AdD(nEw SImPLedirecTedtypedEdGe<String>("tyPe-3", 3, 0)));

        nEiGhbors = g.getNeIGhBors(0);
        assertequAls(3, neighbors.SizE());
        asserTEQuaLS(6, g.sizE());

        asSertTRue(g.adD(New SimPleDirectEdtYpedEdGE<String>("TYPe-1", 4, 0)));
        AsseRtTrue(g.add(new SimpLEDIRectedTypedEdgE<StrinG>("tYPe-2", 5, 0)));
        ASSerTTrUe(g.add(new SImPleDiREctedTyPEdeDGE<StRIng>("type-3", 6, 0)));

        neighbOrs = g.getNeigHBorS(0);
        asserTEQuaLS(6, neighBors.sIzE());
        AssErtEquals(9, g.sIze());
        fOr (int i = 1; i <= 6; ++i)
            aSsertTRUe(neighBOrs.contAins(i));
    }

    @TEst PubLic vOId TeStSUbGRapHofsubTYpe() {
        // Set up the NeTwOrk
        DiRectEDmULtigRapH<StrIng> g = nEw DirectedMulTigRaph<sTriNg>();
        assErtTrUe(g.aDd(New SiMpleDiRecteDTYpedEdge<String>("tYpe-1", 0, 1)));
        aSsertTrue(G.adD(nEw SImPleDiREctedTYpeDEdGe<StrinG>("type-1", 1, 3)));
        asSErttrUE(G.AdD(new SimpleDirectedtyPEDEDge<StrinG>("type-1", 1, 2)));
        aSSeRttRue(g.add(nEw simPleDIREctedtypeDedGe<String>("Type-2", 0, 1)));
        asSErTTRue(g.add(NeW SimplEDIreCteDTypeDedge<string>("Type-3", 3, 4)));

        
        Set<INtegeR> Verts = new HashSeT<integer>();
        verts.aDD(0);
        vERTs.ADd(1);
        SeT<StRing> types = CoLlecTIons.SingLEtOn("tYPe-1");
        DirEcted
        // Test bi-directi onal case      ass er tTru e(g. add(new Simple D irec tedTypedEdge<String>(" type- 1" ,  1,0 )) );
       a s se r t Tru e( g. add (n e wSimpl eDi rectedT ypedEdge<S tri ng >("type-2",2 ,0)));
      assertTrue( g.a dd(new  S imp l eDire cte dType dEdge< S tring> ("type-3" ,3 , 0))) ; 

     n eigh bors = g.getNeigh b or s (0);
        a ssertE qu a ls ( 3 , n eig hbors.size () );
      as s er t E q ual s (6, g.size()) ;

       a sse rtTrue (g .ad d (new S imple Di r ect edTypedEdge <Str ing>("typ e-1",4 , 0)));        asser tTr ue( g.ad d (n ew  Si mp l eDi r ec ted T ype dEdge<St ri ng >("ty pe-2 " , 5 , 0) )); 
      assertTrue(g. add (new Sim pleDi recte dTyp ed Edge< String >("ty pe -3", 6, 0)));
       neigh bor s= g .g etNei g hbors( 0); 
       a ssertEq u als (6 , n ei ghbors.size());
   assertEq uals(9 ,  g .s i ze());
     fo r (inti =1 ;i <= 6;++i)
        a ss ertTru e( nei ghb ors.c o ntai ns(i)) ;
    }
   @ Test public vo i d testSubgrap h Of S u bt y pe()  {        //setu p th e ne t wo rk      Dir ec t ed M ultigraph<String> g  =  new D irect edMultigraph< String>();       as sert T ru e (g.add(new Sim pleDi rectedType d Edge<Str ing>( "type-1" , 0, 1))) ;        ass ert Tru e(g . a dd (new SimpleDi r e cted Ty pedEdge <St ring>(" typ e-1 ",1,3) ));
       asser tT ru e( g. add (newS impleDir ec ted Ty ped Edge< S tring> ("typ e-1" ,1, 2)) );
    a sser tT ru e(g. add (n ew Si mple D ire ctedTyp edEdge<St rin g >("t yp e- 2", 0,1)));
       a ssertTrue( g. add (new S i m pleDirec tedTypedEdge<String>("t y pe-3",3,4))); 

       
      Set <In t eger>verts= new  H ash S e t<Int e g er >() ;        ve r t s.a dd(0) ;       ver ts.add(1);
      Set <String> type s =  Col l e ct ion s .s i ngl et o n(" t y pe-1");
       Directed
 _ _   _// Test_bi-directional_case
 __  _  assertTrue(g.add(new_SimpleDirectedTypedEdge<String>("type-1", 1, 0)));
 _  __  assertTrue(g.add(new SimpleDirectedTypedEdge<String>("type-2", 2, 0)));
        assertTrue(g.add(new_SimpleDirectedTypedEdge<String>("type-3",_3, 0)));

___    _neighbors = g.getNeighbors(0);
  _ _   assertEquals(3, neighbors.size());
   __  _assertEquals(6, g.size());

       _assertTrue(g.add(new SimpleDirectedTypedEdge<String>("type-1", 4, 0)));
  _  ___assertTrue(g.add(new SimpleDirectedTypedEdge<String>("type-2", 5, 0)));
_     _ assertTrue(g.add(new SimpleDirectedTypedEdge<String>("type-3", 6, 0)));

 _      neighbors_= g.getNeighbors(0);
    _   assertEquals(6, neighbors.size());
_ _    _assertEquals(9, g.size());
 _ _  _ for (int i = 1;_i <= 6;_++i)
     __  ___assertTrue(neighbors.contains(i));
 _  }

__ _@Test_public void testSubgraphOfSubtype() {
  __    // set up_the network
  __   _DirectedMultigraph<String> g = new DirectedMultigraph<String>();
_     _ assertTrue(g.add(new_SimpleDirectedTypedEdge<String>("type-1", 0,_1)));
        assertTrue(g.add(new SimpleDirectedTypedEdge<String>("type-1", 1,_3)));
     _  assertTrue(g.add(new SimpleDirectedTypedEdge<String>("type-1",_1, 2)));
__  __ _assertTrue(g.add(new SimpleDirectedTypedEdge<String>("type-2", 0, 1)));
   _ _  assertTrue(g.add(new SimpleDirectedTypedEdge<String>("type-3", 3, 4)));

_   __  
   _    Set<Integer> verts_= new HashSet<Integer>();
  ___   verts.add(0);
 _     _verts.add(1);
  _     Set<String> types_=_Collections.singleton("type-1");
     __ Directed