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