LogicalNotSymbolicValue implements SymbolicValue { public static SymbolicValue create(SymbolicValue negatedValue) { return new LogicalNotSymbolicValue(negatedValue); } private  LogicalNotSymbolicValue(SymbolicValue negatedValue); static SymbolicValue create(SymbolicValue negatedValue); @Override Optional<ProgramState> constrainDependencies(ProgramState state, Constraint constraint); @Override Constraint baseConstraint(ProgramState state); SymbolicValue negatedValue(); @Override String toString();  }
@Test(expected = IllegalArgumentException.class) public void should_throw_on_null_negated_value() throws Exception { LogicalNotSymbolicValue.create(null); }
@Test public void constrain() throws Exception { ProgramState state1 = ProgramState.emptyState().newSymbolicValue(symbol, null); SymbolicValue sv1 = state1.getSymbolicValue(symbol); SymbolicValue not = LogicalNotSymbolicValue.create(sv1); assertThat(state1.constrain(not, TRUTHY)).isEqualTo(state1.constrain(sv1, FALSY)); assertThat(state1.constrain(not, ANY_VALUE)).isEqualTo(state1.constrain(sv1, ANY_VALUE)); }