with API 1 I did this:
dropboxApi.getSession().unlink();
What is the equivelant of that in API 2?
Assuming you're using the API v2 Java SDK, you should just throw away your client object. The API v2 Java SDK doesn't have the same "session" concept as the v1 SDK did.
The unlink method in the v1 SDK didn't revoke the token on the server, but if you do want to explicitly revoke the token on the server using the API v2 SDK, you would additionally use tokenRevoke before throwing it away.
There's a discussion here with some other details that may be relevant depending on your use case:
https://github.com/dropbox/dropbox-sdk-java/issues/92