Finding binary gap in Java
Java conventions

In Java variables are written in "lowerCamelCase", starting with a lowercase letter, so please use getBinaryGap(int n). See also Oracle  code conventions

String conversion

The performance can be increased because you use a conversion to String, while you can solve it using bit-fiddling only. 

Complexity

You code has one loop, with all constant time operations. Integer.toBinaryString(int n) has cost that is linear with n. The total performance will be O(n), that is OK. 

Bit flipping

Following your logic, but all as bit-test:

public static int getBinaryGapBitFiddling(int n) {
    if (n &lt; 5) {
        return 0;
    }
    int currentGap = 0;
    int finalGap = 0;
    int currentBit;
    for (int i=0 ; (currentBit = (1&lt;&lt;i))&lt; n; i++)
    {
        int nextBit = currentBit &lt;&lt; 1;
        if (currentGap == 0) {
            if ( ((currentBit &amp; n) &gt; 0 )  &amp;&amp;  ((nextBit &amp; n ) == 0 )) {
                currentGap++;
            }
        } else {
            if ((nextBit &amp; n ) == 0) {
                currentGap++;
            }
            if ((nextBit &amp; n ) &gt; 0) {
                finalGap = finalGap&lt;currentGap ? currentGap:finalGap;
                currentGap = 0;
            }
        }
    }
    return finalGap;
}


More optimizations

You could probably use bitmasks for faster scanning as well. For example 10 and 01 are the start and end of a run.