Have you tested it?
Is a return required if none are met? Yes, even if it's never used. At the end I added
return 1L;
but it could have been 0 or most any number, because it'll never happen. Even so, the compiler will require it so that every possible path through the method returns a value.
After adding a default return, the important parts of yours look very similar to mine, and testing yours I get correct answers, so I think you did great.
On these assignments with the requirements stated so specifically, I add them right to my code as comments:
// a. A and B are both even: gcd(A, B) = 2*gcd(A/2, B/2)
if ( a % 2 == 0 && b % 2 == 0 )
{
return 2 * ( gcd( a / 2, b / 2 ) );
}
In fact, I add the requirement as comments first and then write the code. It's hard to mess up that way.
Good job with such a light nudge in the right direction!