### Question:
CloudConfigurationListImpl implements CloudConfigurationList { @NotNull @Override public List<CloudConfiguration> getCloudConfigurations() { return configs; } CloudConfigurationListImpl(SlingHttpServletRequest slingRequest); @NotNull @Override List<CloudConfiguration> getCloudConfigurations();  }### Answer:
@SuppressWarnings("unchecked") @Test public void valid() throws IOException, NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { MockRequestPathInfo requestPathInfo = (MockRequestPathInfo) context.request().getRequestPathInfo(); requestPathInfo.setSuffix("/apps/core/wcm/templates/marketocloudconfig"); CloudConfigurationList list = new CloudConfigurationListImpl(context.request()); assertNotNull(list); Field field = list.getClass().getDeclaredField("configs"); field.setAccessible(true); assertNotNull(field.get(list)); CloudConfiguration config = new CloudConfigurationImpl(context.resourceResolver().getResource("/conf/test")); ((List<CloudConfiguration>) field.get(list)).add(config); assertNotNull(list.getCloudConfigurations()); assertEquals(1, list.getCloudConfigurations().size()); config = list.getCloudConfigurations().get(0); assertNotNull(config); assertEquals("/conf/test", config.getItemPath()); assertEquals("/", config.getConfigPath()); }
@Test public void invalid() { MockRequestPathInfo requestPathInfo = (MockRequestPathInfo) context.request().getRequestPathInfo(); requestPathInfo.setSuffix(""); CloudConfigurationList list = new CloudConfigurationListImpl(context.request()); assertNotNull(list); assertNotNull(list.getCloudConfigurations()); assertEquals(0, list.getCloudConfigurations().size()); }