AddObjectSanskritChange implements SanskritChange { @Override public void accept(SanskritChangeVisitor visitor) { visitor.setObject(key, value); } AddObjectSanskritChange(String key, SanskritObject value); @Override void accept(SanskritChangeVisitor visitor);  }
@Test public void callsSetObject() { SanskritObject object = new SanskritObjectImpl(ObjectMapperSupplier.notVersioned(new ObjectMapperFactory().create())); AddObjectSanskritChange change = new AddObjectSanskritChange("key", object); change.accept(visitor); verify(visitor).setObject("key", object); verifyNoMoreInteractions(visitor); }