### Question:
TenantProvisionerService { public void handleHeartbeat(String provisionerId, ProvisionerHeartbeat heartbeat) throws IOException, MissingEntityException { Provisioner provisioner = provisionerStore.getProvisioner(provisionerId); if (provisioner == null) { throw new MissingEntityException("Provisioner " + provisionerId + " not found."); } if (!provisioner.getUsage().equals(heartbeat.getUsage())) { provisioner.setUsage(heartbeat.getUsage()); provisionerStore.writeProvisioner(provisioner); } provisionerStore.setHeartbeat(provisionerId, System.currentTimeMillis()); } @Inject private  TenantProvisionerService(ProvisionerStore provisionerStore,
                                   final TenantStore tenantStore,
                                   LockService lockService,
                                   @Named(Constants.Queue.WORKER_BALANCE) TrackingQueue balanceQueue,
                                   ClusterStoreService clusterStoreService,
                                   ProvisionerRequestService provisionerRequestService,
                                   ResourceService resourceService,
                                   EntityStoreService entityStoreService,
                                   QueueService queueService,
                                   Configuration conf); Collection<TenantSpecification> getAllTenantSpecifications(); TenantSpecification getTenantSpecification(String name); Collection<Provisioner> getAllProvisioners(); Provisioner getProvisioner(String provisionerId); String writeTenantSpecification(TenantSpecification tenantSpecification); boolean satisfiesTenantQuotas(String tenantId, int additionalClusters,
                                       int additionalNodes); boolean satisfiesTenantQuotas(Tenant tenant, int additionalClusters, int additionalNodes); void deleteTenantByName(String name); void deleteProvisioner(String provisionerId); void handleHeartbeat(String provisionerId, ProvisionerHeartbeat heartbeat); void writeProvisioner(Provisioner provisioner); void rebalanceTenantWorkers(String tenantId); void syncResources(Account account); void timeoutProvisioners(long timeoutTs); void bootstrapTenant(String tenantId);  }### Answer:
@Test(expected = MissingEntityException.class) public void testHeartbeatForNonexistantProvisionerThrowsException() throws Exception { service.handleHeartbeat("id123", new ProvisionerHeartbeat(ImmutableMap.<String, Integer>of())); }