@Test public void testDataOpenFileNumWhenCreateFile() { if (os.startsWith(MAC_OS_NAME) || os.startsWith(LINUX_OS_NAME)) { totalOpenFileNumBefore = openFileNumUtil .get(OpenFileNumUtil.OpenFileNumStatistics.DATA_OPEN_FILE_NUM); for (int i = 0; i < testFileNum; i++) { fileList.add(new File(currDir + testFileName + i)); } totalOpenFileNumAfter = openFileNumUtil .get(OpenFileNumUtil.OpenFileNumStatistics.DATA_OPEN_FILE_NUM); totalOpenFileNumChange = totalOpenFileNumAfter - totalOpenFileNumBefore; assertEquals(0, totalOpenFileNumChange); } else { assertEquals(-2, openFileNumUtil.get(OpenFileNumUtil.OpenFileNumStatistics.DATA_OPEN_FILE_NUM)); } }
public int get(OpenFileNumStatistics statistics) { EnumMap<OpenFileNumStatistics, Integer> statisticsMap = getStatisticMap(); return statisticsMap.getOrDefault(statistics, UNKNOWN_STATISTICS_ERROR_CODE); }
OpenFileNumUtil { public int get(OpenFileNumStatistics statistics) { EnumMap<OpenFileNumStatistics, Integer> statisticsMap = getStatisticMap(); return statisticsMap.getOrDefault(statistics, UNKNOWN_STATISTICS_ERROR_CODE); } }
OpenFileNumUtil { public int get(OpenFileNumStatistics statistics) { EnumMap<OpenFileNumStatistics, Integer> statisticsMap = getStatisticMap(); return statisticsMap.getOrDefault(statistics, UNKNOWN_STATISTICS_ERROR_CODE); } private  OpenFileNumUtil(); }
OpenFileNumUtil { public int get(OpenFileNumStatistics statistics) { EnumMap<OpenFileNumStatistics, Integer> statisticsMap = getStatisticMap(); return statisticsMap.getOrDefault(statistics, UNKNOWN_STATISTICS_ERROR_CODE); } private  OpenFileNumUtil(); static OpenFileNumUtil getInstance(); int get(OpenFileNumStatistics statistics); }
OpenFileNumUtil { public int get(OpenFileNumStatistics statistics) { EnumMap<OpenFileNumStatistics, Integer> statisticsMap = getStatisticMap(); return statisticsMap.getOrDefault(statistics, UNKNOWN_STATISTICS_ERROR_CODE); } private  OpenFileNumUtil(); static OpenFileNumUtil getInstance(); int get(OpenFileNumStatistics statistics);  }