protected List<String> substituteChildopts(Object value) {
        return substituteChildopts(value, -1, -1);
    }
@Test
    public void testSubstChildOpts() throws Exception {
        String workerId = "w-01";
        String topoId = "s-01";
        int supervisorPort = 6628;
        int port = 9999;
        int memOnheap = 512;
        int memOffheap = 256;

        LocalAssignment la = new LocalAssignment();
        la.set_topology_id(topoId);

        Map<String, Object> superConf = new HashMap<>();

        AdvancedFSOps ops = mock(AdvancedFSOps.class);
        when(ops.doRequiredTopoFilesExist(superConf, topoId)).thenReturn(true);

        LocalState ls = mock(LocalState.class);

        ResourceIsolationInterface iso = mock(ResourceIsolationInterface.class);

        MockBasicContainer mc = new MockBasicContainer(ContainerType.LAUNCH, superConf,
            "SUPERVISOR", supervisorPort, port, la, iso, ls, workerId, new StormMetricsRegistry(),
            new HashMap<>(), ops, "profile");

        assertListEquals(Arrays.asList(
            "-Xloggc:/tmp/storm/logs/gc.worker-9999-s-01-w-01-9999.log",
            "-Xms256m",
                "-Xmx512m", "-XX:MaxDirectMemorySize=256m"),
                mc.substituteChildopts(
                        "-Xloggc:/tmp/storm/logs/gc.worker-%ID%-%TOPOLOGY-ID%-%WORKER-ID%-%WORKER-PORT%.log -Xms256m -Xmx%HEAP-MEM%m -XX:MaxDirectMemorySize=%OFF-HEAP-MEM%m",
                        memOnheap, memOffheap));

        assertListEquals(
                Arrays.asList(
                        "-Xloggc:/tmp/storm/logs/gc.worker-9999-s-01-w-01-9999.log",
                        "-Xms256m",
                        "-Xmx512m"
                ),
                mc.substituteChildopts(
                        Arrays.asList(
                        "-Xloggc:/tmp/storm/logs/gc.worker-%ID%-%TOPOLOGY-ID%-%WORKER-ID%-%WORKER-PORT%.log", "-Xms256m",
                        "-Xmx%HEAP-MEM%m"
                        ), memOnheap, memOffheap
                )
        );

        assertListEquals(Collections.emptyList(),
                         mc.substituteChildopts(null));
    }