private static <X> X getLast(X[]chain) {
        return chain[ chain.length - 1 ];
    }
Returns the last element from the provided array.
@param chain An array (cannot be null).
@return The last element of the provided array.
xmppserver/src/test/java/org/jivesoftware/openfire/keystore/OpenfireX509TrustManagerTest.java