Circular shift string
Do you have any constraints?


Is your example wrong? I would expected lloHe
If you are concerned of modifying your method parameters make them final. Copy it to local variables and don't change the variables is kind of useless.
Don't use short variables names (exception: the loop counter)
If you use Integer instead of int, you should handle null
Maybe a simple static utility method would be fine here, except you have some inheritance scenario in mind.
Maybe you should also indicate that you are shifting left for positive numbers
You should take the length of you string for the char.


Assuming your example is wrong, what about:

import java.util.Objects;
import javax.annotation.Nonnull;

public final class Shift
{
    @Nonnull
    public static String left( @Nonnull final String string, final int shift )
    {
        final int length = string.length();
        if( length == 0 ) return "";
        final int offset = ((shift % length) + length) % length; // get a positive offset

        return string.substring( offset, length ) + string.substring( 0, offset );
    }

    public static void main( String... args )
    {
        assertEquals( "loHel", Shift.left( "Hello", -2 ) );
        assertEquals( "oHell", Shift.left( "Hello", -1 ) );
        assertEquals( "Hello", Shift.left( "Hello", 0 ) );
        assertEquals( "elloH", Shift.left( "Hello", 1 ) );
        assertEquals( "lloHe", Shift.left( "Hello", 2 ) );
        assertEquals( "loHel", Shift.left( "Hello", 3 ) );
        assertEquals( "oHell", Shift.left( "Hello", 4 ) );
        assertEquals( "Hello", Shift.left( "Hello", 5 ) );
        assertEquals( "elloH", Shift.left( "Hello", 6 ) );
        assertEquals( "", Shift.left( "", 3 ) );
    }

    private static void assertEquals( String expected, String actual )
    {
        if( !Objects.equals( expected, actual ) ) throw new AssertionError( "Expected: &gt;" + expected + "&lt; was: &gt;" + actual + "&lt;" );
    }
}