### Question:
HQServer { List<String> getJavaOpts() { String javaOpts = serverConfigurator.getServerProps().getProperty("server.java.opts"); String[] opts = javaOpts.split("\\s+"); List<String> optList = new ArrayList<String>(Arrays.asList(opts)); optList.add("-Dserver.home=" + serverHome); if ("SunOS".equals(osInfo.getName()) && osInfo.getArch().contains("64-bit")) { log.info("Setting -d64 JAVA OPTION to enable SunOS 64-bit JRE"); optList.add("-d64"); } return optList; } @Autowired  HQServer(@Value("#{ systemProperties['server.home'] }") String serverHome,
                    @Value("#{ systemProperties['engine.home'] }") String engineHome,
                    ProcessManager processManager,
                    EmbeddedDatabaseController embeddedDatabaseController,
                    ServerConfigurator serverConfigurator, EngineController engineController,
                    OperatingSystem osInfo, DataSource dataSource); int start(); void stop(); static void main(String[] args);  }### Answer:
@Test public void testGetJavaOptsSunJava64() { Properties testProps = new Properties(); testProps.put("server.java.opts", "-XX:MaxPermSize=192m -Xmx512m -Xms512m -XX:+HeapDumpOnOutOfMemoryError"); final List<String> expectedOpts = new ArrayList<String>(); expectedOpts.add("-XX:MaxPermSize=192m"); expectedOpts.add("-Xmx512m"); expectedOpts.add("-Xms512m"); expectedOpts.add("-XX:+HeapDumpOnOutOfMemoryError"); expectedOpts.add("-Dserver.home=" + serverHome); expectedOpts.add("-d64"); EasyMock.expect(serverConfigurator.getServerProps()).andReturn(testProps); org.easymock.classextension.EasyMock.expect(osInfo.getName()).andReturn("SunOS"); org.easymock.classextension.EasyMock.expect(osInfo.getArch()).andReturn("64-bit something or other"); replay(); List<String> javaOpts = server.getJavaOpts(); verify(); assertEquals(expectedOpts, javaOpts); }