/** * Gets the proper instance of the {@link IObjectSizes} because it s dependent on the system * test is run on. * * @throws Exception * If Exception occurs. */ @BeforeClass public void initCorrectObjectSizesInstance() throws Exception { objectSizes = new ObjectSizesFactory().getObject(); if ((UnderlyingSystemInfo.JVM_PROVIDER == JvmProvider.SUN) || (UnderlyingSystemInfo.JVM_PROVIDER == JvmProvider.ORACLE) || (UnderlyingSystemInfo.JVM_PROVIDER == JvmProvider.AZUL)) { oracleHashMapTable = HashMap.class.getDeclaredField("table"); // NOPMD if (null != oracleHashMapTable) { oracleHashMapTable.setAccessible(true); } } else if (UnderlyingSystemInfo.JVM_PROVIDER == JvmProvider.IBM) { ibmHashMapTable = HashMap.class.getDeclaredField("table"); // NOPMD if (null != ibmHashMapTable) { ibmHashMapTable.setAccessible(true); } } HASH_MAP_SAFTY_DELTA = objectSizes.getSizeOfHashMapKeyEntrySet(); }