public static String rotateLeft(String str, int rotatePos){		
		
		if( rotatePos < 0 ){
			throw new IllegalArgumentException("rotatePos < 0");
		}
		
		if( str == null ){
			throw new IllegalArgumentException("Can't rotate NULL string");
		}
		
		final int strLength = str.length();
		
		while( rotatePos > strLength ){
			rotatePos = rotatePos % strLength;
		}
		
		// small optimization
		if(  rotatePos == 0 ){
			return str;
		}
		
		final char[] arr = str.toCharArray();		
		
		final BitSet rotatedPositions = new BitSet(rotatePos);		
		
		char temp;
		char temp2;
		
		for( int i = 0; i < rotatePos; i++ ){
			
			// skip already rotated position
			if( rotatedPositions.get(i) ){
				continue;
			}
			
			int index = strLength - rotatePos + i;
			
			temp = arr[i];
			
			while( true ){				
				temp2 = arr[index];
				arr[index] = temp;
				temp = temp2;	
				
				rotatedPositions.set(index); 
				
				if( index == i ){
					break;
				}
				
				if( index < rotatePos ){
					index = strLength - rotatePos + index;
				}
				else {
					index = index - rotatePos;
				}
			}	
		}		
		return new String(arr);		
	}