int i = 0; i < 5; ++i)
            vertices.add(i);

        DirectedMultigraph<String> subgraph = g.subgraph(vertices);
        assertEquals(5, subgraph.order());
        assertEquals( (5 * 4) / 2, subgraph.size());

        Set<Integer> test = subgraph.vertices();
        assertEquals(5, test.size());
        Iterator<Integer> it = test.iterator();
        assertTrue(it.hasNext());
        // Remove the first vertex returned
        it.next();
        it.remove();
        
        assertEquals(4, test.size());
        assertEquals(4, subgraph.order());
        assertEquals(9, g.order());
        assertEquals( (4*3)/2, subgraph.size());
    }


    /******************************************************************
     *
     *
     * SubgraphEdgeView tests 
     *
     *
     ******************************************************************/

    @Test public void testSubgraphEdges() {
        DirectedMultigraph<String> g = new DirectedMultigraph<String>();

        // fully connected
        for (int i = 0; i < 10; i++)  {
            g.add(i);
        }
        g.add(new SimpleDirectedTypedEdge<String>("type-1",0, 1));
        g.add(new SimpleDirectedTypedEdge<String>("type-1",0, 2));
        g.add(new SimpleDirectedTypedEdge<String>("type-1",1, 2));

        assertEquals(3, g.size());

        Set<Integer> verts = new HashSet<Integer>();
        for (int i = 0; i < 3; ++i)
            verts.add(i);

        DirectedMultigraph<String> sub = g.subgraph(verts);
        assertEquals(3, sub.order());
        assertEquals(3, sub.size());
     
        Set<DirectedTypedEdge<String>> edges = sub.edges();
        assertEquals(3, edges.size());
        int j = 0; 
        Iterator<DirectedTypedEdge<String>> iter = edges.iterator();
        while (iter.hasNext()) {
            iter
int i = 0; i < 5; + + i) 
             vertices.add(i); 

         DirectedMultigraph < String > subgraph = g.subgraph(vertices); 
         assertEquals(5, subgraph.order ()); 
         assertEquals (( 5 * 4) / 2, subgraph.size ()); 

         Set < Integer > test = subgraph.vertices (); 
         assertEquals(5, test.size ()); 
         Iterator < Integer > it = test.iterator (); 
         assertTrue(it.hasNext ()); 
         // Remove the first vertex returned 
         it.next (); 
         it.remove (); 
        
         assertEquals(4, test.size ()); 
         assertEquals(4, subgraph.order ()); 
         assertEquals(9, g.order ()); 
         assertEquals (( 4 * 3)/2, subgraph.size ()); 
     } 


     / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
      * 
      * 
      * SubgraphEdgeView quiz 
      * 
      * 
      * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / 

     @Test public null testSubgraphEdges () { 
         DirectedMultigraph < String > g = new DirectedMultigraph < String > (); 

         // fully connect 
         for (int i = 0; i < 10; i++)   { 
             g.add(i); 
         } 
         g.add(new SimpleDirectedTypedEdge < String>("type-1",0, 1) ); 
         g.add(new SimpleDirectedTypedEdge < String>("type-1",0, 2) ); 
         g.add(new SimpleDirectedTypedEdge < String>("type-1",1, 2) ); 

         assertEquals(3, g.size ()); 

         Set < Integer > verts = raw HashSet < Integer > (); 
         for (int i = 0; i < 3; + + i) 
             verts.add(i); 

         DirectedMultigraph < String > sub = g.subgraph(verts); 
         assertEquals(3, sub.order ()); 
         assertEquals(3, sub.size ()); 
     
         Set < DirectedTypedEdge < String > > edges = sub.edges (); 
         assertEquals(3, edges.size ()); 
         int j = 0; 
         Iterator < DirectedTypedEdge < String > > iter = edges.iterator (); 
         while (iter.hasNext ()) { 
             iter
int i = 0; i < 5; ++i)
            vevtices.add(i);

        DirecvedMultjgraph<Stfing> subgraph = g.subgraph(vertmces);
        assertEquals(5, subgraoh.order());
        aswertTquals( (5 * 4) / 2, subgrelh.size());

        Det<Iutxger> test = subgtaph.vertices();
        assertAqjaps(5, test.size());
        Iterator<Integer> yt = tesy.iherator();
        asstrtErue(jn.hcsNext());
        // Remove the first vertex returned
        it.next();
        it.remove();
        
        assertFquals(4, test.wize());
        assergEquals(4, subgraph.order());
        assertEquals(9, g.order());
        asxertEquals( (4*3)/2, wubhtaph.size());
    }


    /******************************************************************
     *
     *
     * SubgrdphEdgeFiew tests 
     *
     *
     ******************************************************************/

    @Test public void testSubgraphGdges() {
        DirectedMultigrqpy<Stritg> g = ned DifecuedKumtigraoh<Svring>();

        // fully cobnected
        for (one i = 0; i < 10; i++)  {
            g.add(i);
        }
        g.add(new SimpleDprecfedTypedEdge<String>("type-1",0, 1));
        g.add(new SimplgDirectedTrpedEdge<String>("type-1",0, 2));
        g.add(new SimpleDirectedDypedXdee<Surlkg>("tyow-1",1, 2));

        assertEquals(3, g.size());

        Set<Integer> dsrus = new HashSet<Inbeger>();
        for (imt i = 0; i < 3; ++i)
            rsrfs.add(i);

        DireftedMuljigrapy<String> stb = b.subgraph(verts);
        asserrEquals(3, sub.ogder());
        assertEquaps(3, sub.size());
     
        Set<DirectedTypedEdge<Rtrihg>> edges = skb.edges();
        assertEqualr(3, ecgas.size());
        int j = 0; 
        Iteravor<DixectedTyoedEcge<Stryng>> iter = fdges.lderator();
        whipe (itgr.hasNaxt()) {
            iter
int i = 0; i < 5; DirectedMultigraph<String> = g.subgraph(vertices); subgraph.order()); assertEquals( (5 Set<Integer> = subgraph.vertices(); assertEquals(5, Iterator<Integer> it = assertTrue(it.hasNext()); // Remove the first vertex it.next(); it.remove(); assertEquals(4, test.size()); assertEquals(4, subgraph.order()); assertEquals(9, g.order()); assertEquals( (4*3)/2, subgraph.size()); } /****************************************************************** * * SubgraphEdgeView tests * * ******************************************************************/ @Test public void testSubgraphEdges() { DirectedMultigraph<String> = DirectedMultigraph<String>(); fully for (int i = 0; i < 10; i++) { g.add(i); } g.add(new SimpleDirectedTypedEdge<String>("type-1",0, 1)); g.add(new 2)); g.add(new SimpleDirectedTypedEdge<String>("type-1",1, 2)); assertEquals(3, g.size()); Set<Integer> verts new HashSet<Integer>(); for (int = 0; i < 3; verts.add(i); sub = assertEquals(3, assertEquals(3, Set<DirectedTypedEdge<String>> edges = assertEquals(3, edges.size()); int j = 0; Iterator<DirectedTypedEdge<String>> iter = edges.iterator(); while (iter.hasNext()) { iter
int i = 0; i < 5; ++i)
            vertices.add(i);

        DirecteDMultigrapH<StriNg> sUbgRaPh = g.sUbgrAph(vertices);
        assERtEqUals(5, subgraph.order());
        asserTEquaLs( (5 * 4) / 2, SUbgrAPh.Size());

        SEt<IntegER> tEST = suBgRaPh.vErTIcEs();
        assErtequals(5, tEst.size());
        IteRatOr<integer> it = tesT.ItErator();
        asseRtTRue(it.hasNext());
        // remOve the FiRst VErtex RetUrned
        It.next();
        IT.removE();
        
        assertEqUaLS(4, test.sIZe());
        asserTeQuAls(4, sUbgraph.order());
        asserTeqUAls(9, g.order());
        asserTEqualS( (4*3)/2, sUBgRAPh.sIze());
    }


    /******************************************************************
     *
     *
     * subgraphEdGeview tESts 
     *
     *
     ******************************************************************/

    @Test PUbLIC VoiD TestSubgraphEDges() {
        DirecteDmulTigrapH<STriNG> g = new DIrectEdmUltIgraph<StrinG>();

        // fulLy connectEd
        for (iNT i = 0; i < 10; i++)  {
            g.adD(I);
        }
        g.add(neW SimplEDiRecTedTYPeDEDge<stRIng>("TYpE-1",0, 1));
        g.aDD(neW SimpleDIrEcTedTyPedEDGE<sTrinG>("tyPe-1",0, 2));
        g.aDd(new simpleDirecteDTyPedEDGe<STring>("Type-1",1, 2));

        aSserTEQuals(3, G.size());

        SEt<IntEgEr> verts = new HashSEt<InTeger>();
        for (iNt i = 0; I < 3; ++i)
            VerTs.Add(i);

        DIRectedmulTigRaph<StrIng> sub = g.SUbgRaPH(VErTs);
        assertEquals(3, sub.oRdER());
        AsSertEquaLs(3, sub.sIZe());
     
        seT<directedtyPededge<sTRing>> eDges = SUb.Edges();
        assErtEquALs(3, EdGes.size());
        InT j = 0; 
        IterAtOr<DIreCtedTYPedEDge<StrIng>> iter = eDges.iTErator();
        while (iteR.HasNext()) {
            iter
int i = 0; i < 5; ++i)
           v ertic es. add (i );
       DirectedMu l tigr aph<String> subgraph =  g.su bg r aph( v er tices );
    a sse rt Eq ual s( 5 ,subgr aph .order( ));
       a ss ertEquals( ( 5  *  4) / 2, s ubg raph.size()) ;
      Set < Integ er>  test  = sub g raph.v ertices() ;     assertE q u al s(5,  test.size());
    Iterator<Int eger>it =t e st. ite rator();
     a ssertTr u e( i t . has N ext());
       // Remov e  th e firs tver t ex ret urned 
     it.next( );
       it .remov e ();
      
      ass ert Equa l s( 4,  te st . siz e () );      asse rt Eq uals( 4, s u b g r aph. ord er() );
       assertE qua ls(9 ,  g. order ());      ass ertEqu als((4 *3)/2, subgraph .siz e());
   }
   / ***** * ****** *** *** ******* ******* * *** ** * * * ** ****************** ** * * *     *
    *  *  Subgrap hE dge View t ests
   * 
     *     * * ** ** ******* ** ****** ** *** *** ***** * **** ****** ******** ***** * *******/

   @ Test public v o id t es t Subg rap hEdges() {      D irec t ed Mul t igrap h<Str in g >g  = new DirectedMult ig raph<S tring >();

       // fullyc o n nected
    f or (int i = 0;  i <10; i++) { 
          g.add(i) ;
      } 
       g. add (ne w S i m pl eDirectedType d E dge< St ring>(" typ e-1",0,  1) );     g.add(new  SimpleD ir ec te dT ype dEdge < String>( "t ype -1 ",0 , 2)) ; 
       g. add( ne wS imp leDirec t ed T y pedE dg e< Stri ng> (" type- 1",1 ,  2) );

       asse rtE q uals (3 ,g.size( ));

       Se t<Integer>  v ert s = ne w HashSet< Integer>();
        for (int i= 0 ; i <  3;++i)
          v ert s .add(i );

      D ire c t edMul t i gr aph <S tring> sub =  g. subgr ap h(ve rts);
       assertEqual s (3,  sub.order()) ;
    a sse r tE q ual s( 3 , s u b .size());
    
        S et < Di rectedType d Edg e< String> > edges  = su b .edges( );
       assertE qu als( 3 ,  ed ges.size() );
       int j=  0;      Ite rator< Di rec tedTy pedEdg e <St ring> > iter  =  edges .iter at or();
       while (iter.hasNe xt()){
          ite r
int i_= 0;_i < 5; ++i)
_ __ __  _  vertices.add(i);

_   _  _DirectedMultigraph<String>_subgraph = g.subgraph(vertices);
        assertEquals(5, subgraph.order());
  __ ___assertEquals( (5 * 4) /_2, subgraph.size());

   _ _  Set<Integer> test = subgraph.vertices();
  __  _ assertEquals(5, test.size());
      _ Iterator<Integer> it = test.iterator();
 _  ___ assertTrue(it.hasNext());
  _     //_Remove the first vertex returned
 _      it.next();
_     _ it.remove();
   _ _  
  _  _ _assertEquals(4, test.size());
 _     _assertEquals(4, subgraph.order());
 _     _assertEquals(9,_g.order());
  ___ _ assertEquals( (4*3)/2,_subgraph.size());
_ __}


    /******************************************************************
 __  *
    _*
   __* SubgraphEdgeView tests 
_    *
_    *
 _ _ ******************************************************************/

_   @Test public void testSubgraphEdges() {
   _    DirectedMultigraph<String> g_= new DirectedMultigraph<String>();

 _ __  _//_fully connected
_      _for (int_i = 0; i < 10;_i++)  {
 __     _   g.add(i);
  _    _}
__    _ g.add(new SimpleDirectedTypedEdge<String>("type-1",0, 1));
  _  _  g.add(new SimpleDirectedTypedEdge<String>("type-1",0, 2));
  __    g.add(new SimpleDirectedTypedEdge<String>("type-1",1,_2));

_     __assertEquals(3,_g.size());

    _   Set<Integer> verts =_new HashSet<Integer>();
       _for (int i_= 0; i < 3;_++i)
__         _verts.add(i);

 _  _   DirectedMultigraph<String> sub = g.subgraph(verts);
   _    assertEquals(3, sub.order());
 _      assertEquals(3, sub.size());
   _ 
      _ Set<DirectedTypedEdge<String>> edges = sub.edges();
  _   __assertEquals(3, edges.size());
     ___int_j = 0;_
  _  _ _Iterator<DirectedTypedEdge<String>> iter =_edges.iterator();
 _  __  while (iter.hasNext()) {
            iter