Java program to check if characters of a string follow pattern defined by given pattern .
import java . util . * ; public class OrderOfCharactersForPattern { public static boolean followsPattern ( String str , String pattern ) {