The user is not already logged in, at least not with Kerberos. The issue is that:
currentUser = UserGroupInformation.getLoginUser();
Will always return a UGI. When there is not TGT, it returns the current OS user with authentication method SIMPLE. That means this:
if (finalPrincipal == null ||
will always fail unless your username and the Kerberos principal match exactly. But in that case, there will be no TGT and you'll get GSS initiate failures later on.
It's possible this is caused by a change in Hadoop at some point, but the unit tests I added fail without the changes to KerberosUtil so I'd say it just plain doesn't work.