### Question:
PasswordMessage extends PGMessage { public String getPassword() { return password; } PasswordMessage(byte[] password);  PasswordMessage(String password);  PasswordMessage(String user, String password, byte[] salt);  PasswordMessage(byte[] user, byte[] password, byte[] salt); String getPassword(); static PasswordMessage loadFromPacket(byte[] packet); @Override String toString();  }### Answer:
@Test public void testToPacket() throws Exception { PasswordMessage passwordMessage = new PasswordMessage("root", "root", salt); assertTrue(Arrays.equals(passwordMessage.toPacket(), packet)); String expectedPassword = "md52bf320b2f4d5724b887efb70ccedae8f"; assertEquals(passwordMessage.getPassword(), expectedPassword); }