void () { DfaValueFactory factory = new DfaValueFactory(getProject()); DfaVariableValue a = factory.getVarFactory().createVariableValue(new MyDescriptor("a")); DfaVariableValue b = factory.getVarFactory().createVariableValue(new MyDescriptor("b")); DfaMemoryStateImpl left = new JvmDfaMemoryStateImpl(factory); assertTrue(left.applyCondition(a.cond(RelationType.GT, factory.fromDfType(DfTypes.intValue(10))))); assertTrue(left.applyCondition(b.cond(RelationType.LT, factory.fromDfType(DfTypes.intValue(1000))))); DfaMemoryStateImpl right = left.createCopy(); assertTrue(left.applyCondition(a.cond(RelationType.LT, b))); assertEquals(RelationType.LT, left.getRelation(a, b)); assertEquals("int in {11..998}", left.getDfType(a).toString()); assertEquals("int in {12..999}", left.getDfType(b).toString()); right.applyCondition(a.cond(RelationType.GT, b)); assertEquals(RelationType.GT, right.getRelation(a, b)); assertEquals("int >= 11", right.getDfType(a).toString()); assertEquals("int <= 999", right.getDfType(b).toString()); DfaMemoryState result = left.tryJoinExactly(right); assertNotNull(result); assertEquals(RelationType.NE, result.getRelation(a, b)); assertEquals("int >= 11", result.getDfType(a).toString()); assertEquals("int <= 999", result.getDfType(b).toString()); DfaMemoryState result2 = right.tryJoinExactly(left); assertNotNull(result2); assertEquals(RelationType.NE, result2.getRelation(a, b)); assertEquals("int >= 11", result2.getDfType(a).toString()); assertEquals("int <= 999", result2.getDfType(b).toString()); assertEquals(result, result2); }