code: @NotNull
  		private Promise<Map<RawServerId, MasterRepository>> doEnsureMasterRepositories() {
  			return ensureMasterNodes()
  					.whenResult($ -> {
  						difference(masterRepositories.keySet(), masterNodes.keySet())
  								.forEach(masterRepositories::remove);
  						difference(masterNodes.keySet(), masterRepositories.keySet())
  								.forEach(serverId -> masterRepositories.put(serverId,
  										new MasterRepository(serverId, repositoryId, masterNodes.get(serverId))));
  					}
docs: region API methods implementation