@Test
public void testNodeAntiAffinityToAttribute() {

  AbstractConstraint constraintExpr =
      targetNotIn(NODE, nodeAttribute("java", "1.8"));
  SingleConstraint sConstraint = (SingleConstraint) constraintExpr;
  assertEquals(NODE, sConstraint.getScope());
  assertEquals(0, sConstraint.getMinCardinality());
  assertEquals(0, sConstraint.getMaxCardinality());
  assertEquals(1, sConstraint.getTargetExpressions().size());
  TargetExpression tExpr =
      sConstraint.getTargetExpressions().iterator().next();
  assertEquals("java", tExpr.getTargetKey());
  assertEquals(TargetType.NODE_ATTRIBUTE, tExpr.getTargetType());
  assertEquals(1, tExpr.getTargetValues().size());
  assertEquals("1.8", tExpr.getTargetValues().iterator().next());
}