@Test
public void testCreateCollectionWhenCollectionExists() throws Exception {

  // GIVEN
  NamedList<Object> namedList = new NamedList<>();
  namedList.add("collections", Arrays.asList("collection2", "collection3"));
  expect(mockedSolrClient.request(anyObject(CollectionAdminRequest.class), anyString())).andReturn(namedList).times(2);
  replay(mockedSolrClient);
  // WHEN
  String result = underTest.createCollection();
  // THEN
  assertEquals("collection1", result);
  verify(mockedSolrClient);
}