source: class PGPassFilesTest {
  
      @Test
      public void shouldLoadValidPGPassFile() throws IOException {
  
target:         File pgPassFile = File.createTempFile("mdms", "pgpass");
          pgPassFile.deleteOnExit();
  
          Files.write(
                  pgPassFile.toPath(),
                  Collections.singleton("myhost:5432:mydb:user:pw"),
                  StandardOpenOption.WRITE
          );
          PGPassFiles.PGPass pgpass = PGPassFiles.load(pgPassFile.getAbsolutePath());
  
          Assert.assertEquals("myhost", pgpass.hostname);
          Assert.assertEquals(5432, pgpass.port);
          Assert.assertEquals("mydb", pgpass.database);
          Assert.assertEquals("user", pgpass.username);
          Assert.assertEquals("pw", pgpass.password);
      }
  
  }