public static int parseCpuAsMilliCpus(String cpu) {
        int suffixIndex = cpu.length() - 1;
        try {
            if ("m".equals(cpu.substring(suffixIndex))) {
                return Integer.parseInt(cpu.substring(0, suffixIndex));
            } else {
                return (int) (Double.parseDouble(cpu) * 1000L);
            }
        } catch (NumberFormatException e) {
            throw new IllegalArgumentException("Failed to parse CPU quantity \"" + cpu + "\"");
        }
    }
@Test
    public void testParse() {
        assertThat(parseCpuAsMilliCpus("100000"), is(100000000));
        assertThat(parseCpuAsMilliCpus("1"), is(1000));
        assertThat(parseCpuAsMilliCpus("1m"), is(1));
        assertThat(parseCpuAsMilliCpus("0.5"), is(500));
        assertThat(parseCpuAsMilliCpus("0"), is(0));
        assertThat(parseCpuAsMilliCpus("0m"), is(0));
        assertThat(parseCpuAsMilliCpus("0.0"), is(0));
        assertThat(parseCpuAsMilliCpus("0.000001"), is(0));

        assertThrows(IllegalArgumentException.class, () -> parseCpuAsMilliCpus("0.0m"));
        assertThrows(IllegalArgumentException.class, () -> parseCpuAsMilliCpus("0.1m"));
    }