    @Test
    public void ensureOver1GBHeapIs256MB() throws Exception {

        int ram = 2048;
        Mockito.when(configuration.getMem()).thenReturn((double) ram);
        ExecutorEnvironmentalVariables env = new ExecutorEnvironmentalVariables(configuration);

        for (Protos.Environment.Variable var : env.getList()) {
            if (var.getName().equals(ExecutorEnvironmentalVariables.ES_HEAP)) {
                String val = var.getValue();
                Pattern pattern = Pattern.compile("(\\d*)m");
                Matcher matcher = pattern.matcher(val);
                assertTrue(matcher.matches());
                assertEquals(Integer.toString(ram - 256), matcher.group(1));
            }
        }
    }