CombinedMaster implements AbstractMaster<D> { @Override public D update(final D document) { final M master = getMasterByScheme(document.getUniqueId().getScheme()); if (master != null) { return master.update(document); } return (new Try<D>() { @Override public D tryMaster(final M master) { return master.update(document); } }).each(document.getUniqueId().getScheme()); } protected  CombinedMaster(List<M> masterList); @Override D get(final UniqueId uniqueId); @Override D get(final ObjectIdentifiable objectId, final VersionCorrection versionCorrection); @Override D add(final D document); @Override D update(final D document); @Override void remove(final ObjectIdentifiable objectIdentifiable); @Override D correct(final D document); @Override final List<UniqueId> replaceVersion(final UniqueId uniqueId, final List<D> replacementDocuments); @Override final List<UniqueId> replaceAllVersions(final ObjectIdentifiable objectId, final List<D> replacementDocuments); @Override List<UniqueId> replaceVersions(final ObjectIdentifiable objectId, final List<D> replacementDocuments); @Override final void removeVersion(final UniqueId uniqueId); @Override final UniqueId replaceVersion(D replacementDocument); @Override final UniqueId addVersion(ObjectIdentifiable objectId, D documentToAdd); @Override Map<UniqueId, D> get(Collection<UniqueId> uniqueIds);  }
@Test public void update() { cMaster.update(d1); cMaster.update(d1); verify(m1, times(2)).update(d1); }