public boolean matches(String text) {
        if (text == null) {
            return false;
        }
        if (this.regex) {
            final Pattern rx;
            if (this.caseSensitive) {
                rx = Pattern.compile(this.value);
            } else {
                rx = Pattern.compile(this.value, Pattern.CASE_INSENSITIVE);
            }
            return rx.matcher(text).matches();
        } else {
            if (this.caseSensitive) {
                return value.equals(text);
            } else {
                return value.equalsIgnoreCase(text);
            }
        }
    }
@Test
    public void testMatches() {
        String text = "Simple";

        PropertyType instance = new PropertyType();
        instance.setValue("simple");
        assertTrue(instance.matches(text));
        instance.setCaseSensitive(true);
        assertFalse(instance.matches(text));

        instance.setValue("s.*le");
        instance.setRegex(true);
        assertFalse(instance.matches(text));
        instance.setCaseSensitive(false);
        assertTrue(instance.matches(text));
    }