static Properties loadPropertiesFile(File homeDir) {
    Properties p = new Properties();
    File propsFile = new File(new File(homeDir, "conf"), "sonar.properties");
    if (propsFile.exists()) {
      try (Reader reader = new InputStreamReader(new FileInputStream(propsFile), UTF_8)) {
        p.load(reader);
        return p;
      } catch (IOException e) {
        throw new IllegalStateException("Cannot open file " + propsFile, e);
      }
    } else {
      throw new IllegalStateException("Configuration file not found: " + propsFile);
    }
  }
@Test
  public void loadPropertiesFile_reads_sonar_properties_content() throws IOException {
    File homeDir = temporaryFolder.newFolder();
    File confDir = new File(homeDir, "conf");
    confDir.mkdirs();
    File sonarProperties = new File(confDir, "sonar.properties");
    sonarProperties.createNewFile();
    Files.write(sonarProperties.toPath(), Arrays.asList("foo=bar"));

    Properties properties = Shutdowner.loadPropertiesFile(homeDir);

    assertThat(properties.getProperty("foo")).isEqualTo("bar");
  }