### Question:
IntercomMetricCollector implements MetricCollector { @Override public void addCustomAttributesToUser(final String userId, final Map<String, Object> customAttributes) { try { final User intercomUser = findIntercomUserByUserId(userId); intercomUser.setCustomAttributes(metricToIntercomCustomAttributeMapper.apply(customAttributes)); User.update(intercomUser); } catch (final Exception e) { logger.warn("Error adding custom attributes to Intercom user with id: {} - {} ", userId, 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 shouldNotAddCustomAttributesToUser_withIntercomFindUserException() { final String userId = randomId(); final Map<String, String> params = new HashMap<>(); params.put("user_id", userId); when(User.find(params)).thenThrow(IntercomException.class); final Map<String, Object> customAttributes = mock(Map.class); intercomMetricCollector.addCustomAttributesToUser(userId, customAttributes); verifyStatic(User.class, never()); User.update(any(User.class)); }