Driver method
public static void main ( String [ ] args ) { Vector < String > v = new Vector < > ( ) ; v . addElement ( " ab " ) ; v . addElement ( " aa " ) ; v . addElement ( " aa " ) ; v . addElement ( " bcd " ) ; v . addElement ( " ab " ) ; System . out . println ( removeConsecutiveSame ( v ) ) ; } }