### Question:
IntercomMetricCollector implements MetricCollector { @Override public void updateOrganisation(final MetricOrganisation organisation) { if (organisation == null) { return; } try { final Company company = findIntercomCompanyByExternalCompanyId(organisation.id()); company.setName(organisation.name()); Company.update(company); } catch (final Exception e) { logger.warn("Error updating an Intercom company: {} - {}", organisation.id(), e.getMessage()); } } IntercomMetricCollector(final String personalAccessToken); @Override void createOrganisation(final MetricOrganisation organisation); @Override void updateOrganisation(final MetricOrganisation organisation); @Override void tagOrganisation(final String tagName, final MetricOrganisation metricOrganisation); @Override void createUser(final MetricUser user); @Override void updateUser(final MetricUser user); @Override void addCustomAttributesToUser(final String userId, final Map<String, Object> customAttributes); @Override void addOrganisationToUser(final String userId, final String organisationId); @Override void removeOrganisationFromUser(final String userId, final String organisationId); @Override void deleteUser(final String userId); @Override void sendMetric(final Metric metric); @Override MetricUser getUser(final String userId); @Override void convertExistingContactToUser(final String contactId, final MetricUser metricUser);  }### Answer:
@Test public void shouldUpdateIntercomCompany_withMetricOrganisation() throws Exception { final MetricOrganisation metricOrganisation = randomMetricOrganisation(); final String metricOrganisationId = metricOrganisation.id(); final Map<String, String> expectedFindParams = new HashMap<>(); expectedFindParams.put("company_id", metricOrganisationId); final Company mockCompany = mock(Company.class); mockStatic(Company.class); when(Company.find(expectedFindParams)).thenReturn(mockCompany); intercomMetricCollector.updateOrganisation(metricOrganisation); verify(mockCompany).setName(metricOrganisation.name()); verifyStatic(Company.class); Company.update(mockCompany); }