We could conditionally check java.version for 1.7+ and catch ProtocolException.  Forcing Java to behave itself for this test seems like a more precise solution.