@Test
public void testGetPropertyThrowsWhenDefaultTypeDoesNotMatch()
{

    ConfigurationValue configurationValue = ConfigurationValue.HERD_ENVIRONMENT;
    Class<?> expectedDefaultType = configurationValue.getDefaultValue().getClass();
    Class<?> givenType = Integer.class;
    MockEnvironment environment = new MockEnvironment();
    try
    {
        ConfigurationHelper.getProperty(configurationValue, givenType, environment);
        fail("expected IllegalArgumentException, but no exception was thrown");
    }
    catch (Exception e)
    {
        assertEquals("thrown exception type", IllegalStateException.class, e.getClass());
        assertEquals("thrown exception message",
            "targetType \"" + givenType + "\" is not assignable from the default value of type \"" + expectedDefaultType + "\" for configuration value " +
                "\"HERD_ENVIRONMENT\".", e.getMessage());
    }
}