@Test
public void testUpdateAttachmentsFromRequestOneArrayIsNull() {

    PortletRequest request = Mockito.mock(PortletRequest.class);
    new TestUserCacheHolder().enable();
    // fill existing data
    Set<Attachment> documentAttachments = ImmutableSet.of(); // use immutable set to ensure that set is not changed.
    // fill request
    setAttachmentIds(request, "1", "2", "3");
    // run test
    Set<Attachment> updatedAttachments = PortletUtils.updateAttachmentsFromRequest(request, documentAttachments);
    assertTrue(updatedAttachments.isEmpty());
    assertThat(updatedAttachments, is(sameInstance(documentAttachments)));
}