private static StatisticsUnit loadUnit(int unitNumber) { StatisticsUnit unit = new StatisticsUnit(unitNumber); if (!ApplicationManager.getApplication().isUnitTestMode()){ String path = getPathToUnit(unitNumber); try (InputStream in = new ScrambledInputStream(new BufferedInputStream(new FileInputStream(path)))) { unit.read(in); } catch(IOException | WrongFormatException ignored){ } } return unit; }