/** * {@inheritDoc} */ @Override public boolean mutate(TestCase test, TestFactory factory) { if (!hasMoreThanOneValue()) return false; T oldVal = value; while (value == oldVal && value != null) { if (Randomness.nextDouble() <= Properties.RANDOM_PERTURBATION) { // When using TT, then an integer may represent a boolean, // and we would lose "negation" as a mutation if (Properties.TT && getClass().equals(IntPrimitiveStatement.class)) { if (Randomness.nextDouble() <= Properties.RANDOM_PERTURBATION) { // mutateTransformedBoolean(test); ((IntPrimitiveStatement) this).negate(); } else randomize(); } else { randomize(); } } else delta(); } return true; }
copy = originalStatement.clone(test); if (originalStatement instanceof PrimitiveStatement<?>) { ((PrimitiveStatement<?>)copy).delta();