@SuppressWarnings("unchecked")
    public T getValue() {
        final T value = (T) FROM_STRING.get(getConverterClass()).apply(JiveGlobals.getProperty(key), this);
        if (value == null || (Collection.class.isAssignableFrom(value.getClass()) && ((Collection) value).isEmpty())) {
            return defaultValue;
        }
        if (minValue != null && ((Comparable) minValue).compareTo(value) > 0) {
            LOGGER.warn("Configured value of {} is less than the minimum value of {} for the SystemProperty {} - will use default value of {} instead",
                value, minValue, key, defaultValue);
            return defaultValue;
        }
        if (maxValue != null && ((Comparable) maxValue).compareTo(value) < 0) {
            LOGGER.warn("Configured value of {} is more than the maximum value of {} for the SystemProperty {} - will use default value of {} instead",
                value, maxValue, key, defaultValue);
            return defaultValue;
        }
        return value;
    }
@Test
    public void willNotReturnAnotherClass() {

        final SystemProperty<Class> classProperty = SystemProperty.Builder.ofType(Class.class)
            .setKey("another-subclass-property")
            .setDefaultValue(DefaultAuthProvider.class)
            .setBaseClass(AuthProvider.class)
            .setDynamic(false)
            .build();

        JiveGlobals.setProperty("another-subclass-property", "java.lang.Object");

        assertThat(classProperty.getValue(), is(equalTo(DefaultAuthProvider.class)));
    }