1- package ai .timefold .solver .test .api .solver .change ;
1+ package ai .timefold .solver .core .api .solver .change ;
22
33import java .util .IdentityHashMap ;
44import java .util .Map ;
55import java .util .function .Consumer ;
66
7- import ai .timefold .solver .core .api .solver .change .ProblemChangeDirector ;
8-
9- import org .jspecify .annotations .NonNull ;
7+ import org .jspecify .annotations .NullMarked ;
108import org .jspecify .annotations .Nullable ;
119
1210/**
13- * Use for unit-testing {@link ai.timefold.solver.core.api.solver.change.ProblemChange}s.
14- *
11+ * Use for unit-testing {@link ProblemChange}s.
1512 * Together with Mockito this class makes it possible to verify that a
16- * {@link ai.timefold.solver.core.api.solver.change. ProblemChange} implementation correctly calls methods of
13+ * {@link ProblemChange} implementation correctly calls methods of
1714 * the {@link ProblemChangeDirector}.
18- *
15+ * <p>
1916 * Example of usage:
2017 *
2118 * <pre>
2724 * }
2825 * </pre>
2926 */
27+ @ NullMarked
3028public class MockProblemChangeDirector implements ProblemChangeDirector {
3129
3230 private Map <Object , Object > lookUpTable = new IdentityHashMap <>();
3331
3432 @ Override
35- public <Entity > void addEntity (@ NonNull Entity entity , @ NonNull Consumer <Entity > entityConsumer ) {
33+ public <Entity > void addEntity (Entity entity , Consumer <Entity > entityConsumer ) {
3634 entityConsumer .accept (this .lookUpWorkingObject (entity ));
3735 }
3836
3937 @ Override
40- public <Entity > void removeEntity (@ NonNull Entity entity , Consumer <Entity > entityConsumer ) {
38+ public <Entity > void removeEntity (Entity entity , Consumer <Entity > entityConsumer ) {
4139 entityConsumer .accept (this .lookUpWorkingObject (entity ));
4240 }
4341
4442 @ Override
45- public <Entity > void changeVariable (@ NonNull Entity entity , @ NonNull String variableName ,
46- @ NonNull Consumer <Entity > entityConsumer ) {
43+ public <Entity > void changeVariable (Entity entity , String variableName , Consumer <Entity > entityConsumer ) {
4744 entityConsumer .accept (this .lookUpWorkingObject (entity ));
4845 }
4946
5047 @ Override
51- public <ProblemFact > void addProblemFact (@ NonNull ProblemFact problemFact ,
52- @ NonNull Consumer <ProblemFact > problemFactConsumer ) {
48+ public <ProblemFact > void addProblemFact (ProblemFact problemFact , Consumer <ProblemFact > problemFactConsumer ) {
5349 problemFactConsumer .accept (this .lookUpWorkingObject (problemFact ));
5450 }
5551
5652 @ Override
57- public <ProblemFact > void removeProblemFact (@ NonNull ProblemFact problemFact ,
58- @ NonNull Consumer <ProblemFact > problemFactConsumer ) {
53+ public <ProblemFact > void removeProblemFact (ProblemFact problemFact , Consumer <ProblemFact > problemFactConsumer ) {
5954 problemFactConsumer .accept (this .lookUpWorkingObject (problemFact ));
6055 }
6156
6257 @ Override
63- public <EntityOrProblemFact > void changeProblemProperty (@ NonNull EntityOrProblemFact problemFactOrEntity ,
64- @ NonNull Consumer <EntityOrProblemFact > problemFactOrEntityConsumer ) {
58+ public <EntityOrProblemFact > void changeProblemProperty (EntityOrProblemFact problemFactOrEntity ,
59+ Consumer <EntityOrProblemFact > problemFactOrEntityConsumer ) {
6560 problemFactOrEntityConsumer .accept (this .lookUpWorkingObject (problemFactOrEntity ));
6661 }
6762
@@ -86,7 +81,7 @@ public void updateShadowVariables() {
8681 /**
8782 * Defines what {@link #lookUpWorkingObject(Object)} returns.
8883 */
89- public @ NonNull LookUpMockBuilder whenLookingUp (Object forObject ) {
84+ public LookUpMockBuilder whenLookingUp (Object forObject ) {
9085 return new LookUpMockBuilder (forObject );
9186 }
9287
0 commit comments