@Test
public void shouldSupportPasswordsWithColon() throws IOException {

    File pgPassFile = File.createTempFile("mdms", "pgpass");
    pgPassFile.deleteOnExit();
    Files.write(
            pgPassFile.toPath(),
            Collections.singleton("myhost:5432:mydb:user:%:%:%::%"),
            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("%:%:%::%", pgpass.password);
}