public int asInteger() {
        checkState(type == Type.INTEGER, "Value is not an integer");
        return Integer.parseInt(value);
    }
@Test
    public void asInteger() {
        ConfigProperty p = defineProperty("foo", INTEGER, "123", "Foo Prop");
        validate(p, "foo", INTEGER, "123", "123");
        assertEquals("incorrect value", 123, p.asInteger());
        assertEquals("incorrect value", 123L, p.asLong());
    }