MockTimeZone extends TimeZone { public static void reset(){ TimeZone.setDefault((TimeZone) cloneGMT.clone()); }  static void reset();  }
@Test public void testGettingGMT(){ TimeZone defaultTZ = TimeZone.getDefault(); TimeZone gb = TimeZone.getTimeZone("GB"); Assume.assumeNotNull(gb); try { TimeZone.setDefault(gb); MockTimeZone.reset(); TimeZone res = TimeZone.getDefault(); Assert.assertEquals("GMT",res.getID()); } finally { TimeZone.setDefault(defaultTZ); } }