int h = input.lastIndexOf( 'h' ); int f = input.lastIndexOf( 'f' );  if( h > f && h > -1 ) return Deflater.HUFFMAN_ONLY; else if( f > -1 ) return Deflater.FILTERED; else return Deflater.DEFAULT_STRATEGY;
for( int i = input.length() - 1; i >= 0; i-- ) { char ch = input.charAt(i); switch (ch) { case 'f': return Deflater.FILTERED; case 'h': return Deflater.HUFFMAN_ONLY; } } return Deflater.DEFAULT_STRATEGY;
  private int getCompressionStrategy( String input )  {    int h = input.lastIndexOf( 'h' );    int f = input.lastIndexOf( 'f' );    if( h > f && h > -1 )      return Deflater.HUFFMAN_ONLY;    else if( f > -1 )      return Deflater.FILTERED;    else      return Deflater.DEFAULT_STRATEGY;  }