Driver program
int main ( ) { String str = " engineers ▁ rock " ; String pattern = " er " ; System . out . println ( " Expected : ▁ true , ▁ Actual : ▁ " + followsPattern ( str , pattern ) ) ; str = " engineers ▁ rock " ; pattern = " egr " ; System . out . println ( " Expected : ▁ false , ▁ Actual : ▁ " + followsPattern ( str , pattern ) ) ; str = " engineers ▁ rock " ; pattern = " gsr " ; System . out . println ( " Expected : ▁ false , ▁ Actual : ▁ " + followsPattern ( str , pattern ) ) ; str = " engineers ▁ rock " ; pattern = " eger " ; System . out . println ( " Expected : ▁ true , ▁ Actual : ▁ " + followsPattern ( str , pattern ) ) ; return 0 ; } }