comefrom: <awangdev>Word Pattern_2.java
code: public boolean wordPattern(String pattern, String str) {
          if (pattern != null && str != null && pattern.length() == 0 && str.length() == 0) {
  	        return true;
  	    }
  	    if (pattern == null || pattern.length() == 0 || str == null || str.length() == 0) {
  	        return false;
  	    } 
  	    String[] strArr = str.split(" ");
  	    if (pattern.length() != strArr.length) {
  	        return false;
  	    }
  	    
  	    HashMap<Character, String> map = new HashMap<Character, String>();
  	    HashMap<String, Character> mapStr = new HashMap<String, Character>();
  	    
  	    for (int i = 0; i < strArr.length; i++){
  	        if (!map.containsKey(pattern.charAt(i))) {
  	            map.put(pattern.charAt(i), strArr[i]);
  	        } else {
  	            if (!map.get(pattern.charAt(i)).equals(strArr[i])) {
  	                return false;
  	            }
  	        }    
  	        if (!mapStr.containsKey(strArr[i])) {
  	            mapStr.put(strArr[i], pattern.charAt(i));
  	        } else {
  	            if (mapStr.get(strArr[i]) != pattern.charAt(i)) {
  	                return false;
  	            }
  	        }  
  	    } 
  	    return true;
      }
masked: public boolean var_0 ( String var_1 , String var_2 ) {
    if ( var_1 != null && var_2 != null && var_1 . length ( ) == 0 && var_2 . length ( ) == 0 ) {
      return true ;
    }
    if ( var_1 == null || var_1 . length ( ) == 0 || var_2 == null || var_2 . length ( ) == 0 ) {
      return false ;
    }
    String [ ] var_3 = var_2 . split ( " " ) ;
    if ( var_1 . length ( ) != var_3 . length ) {
      return false ;
    }
    HashMap < Character , String > var_4 = new HashMap < Character , String > ( ) ;
    HashMap < String , Character > var_5 = new HashMap < String , Character > ( ) ;
    for ( int var_6 = 0 ;
    var_6 < var_3 . length ;
    var_6 ++ ) {
      if ( ! var_4 . containsKey ( var_1 . charAt ( var_6 ) ) ) {
        var_4 . put ( var_1 . charAt ( var_6 ) , var_3 [ var_6 ] ) ;
      }
      else {
        if ( ! var_4 . get ( var_1 . charAt ( var_6 ) ) . equals ( var_3 [ var_6 ] ) ) {
          return false ;
        }
      }
      if ( ! var_5 . containsKey ( var_3 [ var_6 ] ) ) {
        var_5 . put ( var_3 [ var_6 ] , var_1 . charAt ( var_6 ) ) ;
      }
      else {
        if ( var_5 . get ( var_3 [ var_6 ] ) != var_1 . charAt ( var_6 ) ) {
          return false ;
        }
      }
    }
    return true ;
  }
  