### Question:
StartupMessage extends PGMessage { public String getDatabase() { return database; } StartupMessage(String user, String database);  StartupMessage(String user); Map<String, String> getArgs(); void addArgs(String argName, String argValue); void addArgsIfAbsent(String argName, String argValue); String getUser(); String getDatabase(); void setProtocolVersionNum(int protocolVersionNum); static StartupMessage loadFromPacket(byte[] packet); static StartupMessage loadFromVirtualPacket(byte[] packet); @Override String toString(); static final int PROTOCOL_VERSION_NUM; }### Answer:
@Test public void testGetDatabase() throws Exception { StartupMessage startupMessage = StartupMessage.loadFromPacket(withDatabasePacket); String expectedDatabase = "postgres"; assertEquals(startupMessage.getDatabase(), expectedDatabase); StartupMessage startupMessage1 = StartupMessage.loadFromPacket(withoutDBPacket); String expectedDatabase1 = "root"; assertEquals(startupMessage1.getDatabase(), expectedDatabase1); }