### Question:
PortletRequest implements Request { @Override public List<Object> getProperties(String key) { List<Object> result = new ArrayList<Object>(); result.addAll(Arrays.asList(this.portletRequest.getParameterValues(key))); result.add(this.portletRequest.getAttribute(key)); return result; } PortletRequest(javax.portlet.PortletRequest portletRequest); javax.portlet.PortletRequest getPortletRequest(); @Override Object getProperty(String key); @Override List<Object> getProperties(String key); @Override void setProperty(String key, Object value); @Override void removeProperty(String key);  }### Answer:
@Test public void getPropertiesWhenNoConflict() { final javax.portlet.PortletRequest portletRequest = mockery.mock(javax.portlet.PortletRequest.class); this.mockery.checking(new Expectations() {{ oneOf(portletRequest).getParameterValues("key"); will(returnValue(new String[] {"value1", "value2"})); oneOf(portletRequest).getAttribute("key"); will(returnValue("value3")); }}); PortletRequest request = new PortletRequest(portletRequest); List<Object> values = request.getProperties("key"); Assert.assertEquals(Arrays.asList("value1", "value2", "value3"), values); }
@Test public void getPropertiesWhenConflict() { final javax.portlet.PortletRequest portletRequest = mockery.mock(javax.portlet.PortletRequest.class); this.mockery.checking(new Expectations() {{ oneOf(portletRequest).getParameterValues("key"); will(returnValue(new String[] {"value"})); oneOf(portletRequest).getAttribute("key"); will(returnValue("value")); }}); PortletRequest request = new PortletRequest(portletRequest); List<Object> values = request.getProperties("key"); Assert.assertEquals(Arrays.asList("value", "value"), values); }