@Test
public void testComparisons() throws Exception {

  List<MyAttributeValue> arguments = new ArrayList<MyAttributeValue>();
  arguments.clear();
  arguments.add(new MyAttributeValueInteger(4, null));
  arguments.add(new MyAttributeValueInteger(7, null));
  assertFalse(evaulateFunction(new URI(
      "urn:oasis:names:tc:xacml:1.0:function:integer-greater-than"), arguments));
  assertFalse(evaulateFunction(new URI(
      "urn:oasis:names:tc:xacml:1.0:function:integer-greater-than-or-equal"), arguments));
  assertTrue(evaulateFunction(new URI("urn:oasis:names:tc:xacml:1.0:function:integer-less-than"),
      arguments));
  assertTrue(evaulateFunction(new URI(
      "urn:oasis:names:tc:xacml:1.0:function:integer-less-than-or-equal"), arguments));
  arguments.clear();
  arguments.add(new MyAttributeValueInteger(42, null));
  arguments.add(new MyAttributeValueInteger(42, null));
  assertFalse(evaulateFunction(new URI(
      "urn:oasis:names:tc:xacml:1.0:function:integer-greater-than"), arguments));
  assertTrue(evaulateFunction(new URI(
      "urn:oasis:names:tc:xacml:1.0:function:integer-greater-than-or-equal"), arguments));
  assertFalse(evaulateFunction(
      new URI("urn:oasis:names:tc:xacml:1.0:function:integer-less-than"), arguments));
  assertTrue(evaulateFunction(new URI(
      "urn:oasis:names:tc:xacml:1.0:function:integer-less-than-or-equal"), arguments));
  arguments.clear();
  arguments.add(new MyAttributeValueInteger(142, null));
  arguments.add(new MyAttributeValueInteger(42, null));
  assertTrue(evaulateFunction(new URI(
      "urn:oasis:names:tc:xacml:1.0:function:integer-greater-than"), arguments));
  assertTrue(evaulateFunction(new URI(
      "urn:oasis:names:tc:xacml:1.0:function:integer-greater-than-or-equal"), arguments));
  assertFalse(evaulateFunction(
      new URI("urn:oasis:names:tc:xacml:1.0:function:integer-less-than"), arguments));
  assertFalse(evaulateFunction(new URI(
      "urn:oasis:names:tc:xacml:1.0:function:integer-less-than-or-equal"), arguments));
  arguments.clear();
  arguments.add(new MyAttributeValueDate("2010-10-10", null));
  arguments.add(new MyAttributeValueDate("2011-11-11", null));
  assertFalse(evaulateFunction(
      new URI("urn:oasis:names:tc:xacml:1.0:function:date-greater-than"), arguments));
  assertFalse(evaulateFunction(new URI(
      "urn:oasis:names:tc:xacml:1.0:function:date-greater-than-or-equal"), arguments));
  assertTrue(evaulateFunction(new URI("urn:oasis:names:tc:xacml:1.0:function:date-less-than"),
      arguments));
  assertTrue(evaulateFunction(new URI(
      "urn:oasis:names:tc:xacml:1.0:function:date-less-than-or-equal"), arguments));
  arguments.clear();
  arguments.add(new MyAttributeValueDate("2010-01-01", null));
  arguments.add(new MyAttributeValueDate("2010-01-01", null));
  assertFalse(evaulateFunction(
      new URI("urn:oasis:names:tc:xacml:1.0:function:date-greater-than"), arguments));
  assertTrue(evaulateFunction(new URI(
      "urn:oasis:names:tc:xacml:1.0:function:date-greater-than-or-equal"), arguments));
  assertFalse(evaulateFunction(new URI("urn:oasis:names:tc:xacml:1.0:function:date-less-than"),
      arguments));
  assertTrue(evaulateFunction(new URI(
      "urn:oasis:names:tc:xacml:1.0:function:date-less-than-or-equal"), arguments));
  arguments.clear();
  arguments.add(new MyAttributeValueDate("2011-11-11", null));
  arguments.add(new MyAttributeValueDate("2010-10-10", null));
  assertTrue(evaulateFunction(new URI("urn:oasis:names:tc:xacml:1.0:function:date-greater-than"),
      arguments));
  assertTrue(evaulateFunction(new URI(
      "urn:oasis:names:tc:xacml:1.0:function:date-greater-than-or-equal"), arguments));
  assertFalse(evaulateFunction(new URI("urn:oasis:names:tc:xacml:1.0:function:date-less-than"),
      arguments));
  assertFalse(evaulateFunction(new URI(
      "urn:oasis:names:tc:xacml:1.0:function:date-less-than-or-equal"), arguments));
  
  arguments.clear();
  arguments.add(new MyAttributeValueDateTime("2010-10-10T10:10:10Z", null));
  arguments.add(new MyAttributeValueDateTime("2011-11-11T10:10:10Z", null));
  assertFalse(evaulateFunction(
      new URI("urn:oasis:names:tc:xacml:1.0:function:dateTime-greater-than"), arguments));
  assertFalse(evaulateFunction(new URI(
      "urn:oasis:names:tc:xacml:1.0:function:dateTime-greater-than-or-equal"), arguments));
  assertTrue(evaulateFunction(new URI("urn:oasis:names:tc:xacml:1.0:function:dateTime-less-than"),
      arguments));
  assertTrue(evaulateFunction(new URI(
      "urn:oasis:names:tc:xacml:1.0:function:dateTime-less-than-or-equal"), arguments));
  arguments.clear();
  arguments.add(new MyAttributeValueDateTime("2010-01-01T10:10:10Z", null));
  arguments.add(new MyAttributeValueDateTime("2010-01-01T10:10:10Z", null));
  assertFalse(evaulateFunction(
      new URI("urn:oasis:names:tc:xacml:1.0:function:dateTime-greater-than"), arguments));
  assertTrue(evaulateFunction(new URI(
      "urn:oasis:names:tc:xacml:1.0:function:dateTime-greater-than-or-equal"), arguments));
  assertFalse(evaulateFunction(new URI("urn:oasis:names:tc:xacml:1.0:function:dateTime-less-than"),
      arguments));
  assertTrue(evaulateFunction(new URI(
      "urn:oasis:names:tc:xacml:1.0:function:dateTime-less-than-or-equal"), arguments));
  arguments.clear();
  arguments.add(new MyAttributeValueDateTime("2011-11-11T10:10:10Z", null));
  arguments.add(new MyAttributeValueDateTime("2010-10-10T10:10:10Z", null));
  assertTrue(evaulateFunction(new URI("urn:oasis:names:tc:xacml:1.0:function:dateTime-greater-than"),
      arguments));
  assertTrue(evaulateFunction(new URI(
      "urn:oasis:names:tc:xacml:1.0:function:dateTime-greater-than-or-equal"), arguments));
  assertFalse(evaulateFunction(new URI("urn:oasis:names:tc:xacml:1.0:function:dateTime-less-than"),
      arguments));
  assertFalse(evaulateFunction(new URI(
      "urn:oasis:names:tc:xacml:1.0:function:dateTime-less-than-or-equal"), arguments));
}