CustomFieldsAdapter { public List<String> getCustomFieldKeyNames() { List<String> result = new ArrayList<>(customFields.size()); for (CustomField customField : customFields) { result.add(customField.getKey()); } return result; } CustomFieldsAdapter(CustomField... customFields); List<String> getCustomFieldKeyNames(); List<String> getExcludedFieldKeyNames();  }
@Test public void returnsEmptyCustomFieldsWithoutConfig() throws Exception { CustomFieldsAdapter adapter = new CustomFieldsAdapter(); assertThat(adapter.getCustomFieldKeyNames(), is(empty())); }
@Test public void providesGivenCustomFields() throws Exception { CustomFieldsAdapter adapter = new CustomFieldsAdapter(CustomField.newBuilder().setKey("this key").build(), CustomField.newBuilder().setKey("that key").build()); assertThat(adapter.getCustomFieldKeyNames(), containsInAnyOrder("this key", "that key")); }