PomChangeDependency extends AbstractArtifactPomOperation<PomChangeDependency> implements ChangeOrRemoveElement<PomChangeDependency> { public PomChangeDependency removeOptional() { removeOptional = true; return this; } PomChangeDependency();  PomChangeDependency(String groupId, String artifactId); PomChangeDependency setVersion(String version); PomChangeDependency setScope(String scope); PomChangeDependency setType(String type); PomChangeDependency setOptional(); PomChangeDependency removeVersion(); PomChangeDependency removeScope(); PomChangeDependency removeType(); PomChangeDependency removeOptional(); PomChangeDependency failIfNotPresent(); PomChangeDependency warnIfNotPresent(); PomChangeDependency noOpIfNotPresent(); String getVersion(); String getScope(); String getType(); Boolean isOptional(); boolean isRemoveVersion(); boolean isRemoveScope(); boolean isRemoveType(); boolean isRemoveOptional(); @Override String getDescription();  }
@Test public void removeOptionalTest() throws IOException, XmlPullParserException { PomChangeDependency uut = new PomChangeDependency("commons-io", "commons-io").relative("pom.xml").removeOptional(); assertTrue(getDependencyBeforeChange(uut).isOptional()); executeAndAssertSuccess(uut); assertFalse(getDependencyAfterChange(uut).isOptional()); }