static int loadRequiredIntProp(
        Properties props,
        String keyName
    ) {
        String value = props.getProperty(keyName);
        if (value == null) {
            throw new RuntimeException("Failed to find " + keyName);
        }
        try {
            return Integer.parseInt(value);
        } catch (NumberFormatException e) {
            throw new RuntimeException("Unable to read " + keyName + " as a base-10 number.", e);
        }
    }
@Test
    public void loadNonIntegerRequiredIntProp() {
        Properties props = new Properties();
        props.setProperty("foo.bar", "b");
        assertEquals("Unable to read foo.bar as a base-10 number.",
            assertThrows(RuntimeException.class,
                () -> PropertiesUtils.loadRequiredIntProp(props, "foo.bar")).
                    getMessage());
    }