OpearPlanMojo extends AbstractCommonMojo implements MojoWithPlanParams { @Override public PlanBuilderParams getPlanBuilderParams() { return Optional.ofNullable(planParams).orElse(new PlanParams()); }  @Override void execute(); @Override PlanBuilderParams getPlanBuilderParams();  }
@Test public void testGetPlanBuilderParams() { OpearPlanMojo mojo = newMojo(); assertNotNull("always have plan params", mojo.getPlanBuilderParams()); mojo.planParams = new PlanParams(); assertSame("same plan params", mojo.planParams, mojo.getPlanBuilderParams()); }