@Test public void testExecute() { final List<Long> list = Arrays.asList(1L, 2L, SELF_ID, 3L, 4L); context.checking(new Expectations() { { oneOf(mapper).execute(SELF_ID); will(returnValue(list)); } }); List<Long> resultList = sut.execute(SELF_ID); context.assertIsSatisfied(); assertEquals(4, resultList.size()); for (int i = 0; i < 4; i++) { assertEquals((Long) (long) (i + 1), resultList.get(i)); } }
@Override public List<Long> execute(final Long inRequest) { List<Long> fullList = mapper.execute(inRequest); if (fullList.isEmpty()) { return fullList; } else { List<Long> newList = new ArrayList<Long>(fullList.size()); for (Long id : fullList) { if (!id.equals(inRequest)) { newList.add(id); } } return newList; } }
ExcludeSelfMapperDecorator implements DomainMapper<Long, List<Long>> { @Override public List<Long> execute(final Long inRequest) { List<Long> fullList = mapper.execute(inRequest); if (fullList.isEmpty()) { return fullList; } else { List<Long> newList = new ArrayList<Long>(fullList.size()); for (Long id : fullList) { if (!id.equals(inRequest)) { newList.add(id); } } return newList; } } }
ExcludeSelfMapperDecorator implements DomainMapper<Long, List<Long>> { @Override public List<Long> execute(final Long inRequest) { List<Long> fullList = mapper.execute(inRequest); if (fullList.isEmpty()) { return fullList; } else { List<Long> newList = new ArrayList<Long>(fullList.size()); for (Long id : fullList) { if (!id.equals(inRequest)) { newList.add(id); } } return newList; } } ExcludeSelfMapperDecorator(final DomainMapper<Long, List<Long>> inMapper); }
ExcludeSelfMapperDecorator implements DomainMapper<Long, List<Long>> { @Override public List<Long> execute(final Long inRequest) { List<Long> fullList = mapper.execute(inRequest); if (fullList.isEmpty()) { return fullList; } else { List<Long> newList = new ArrayList<Long>(fullList.size()); for (Long id : fullList) { if (!id.equals(inRequest)) { newList.add(id); } } return newList; } } ExcludeSelfMapperDecorator(final DomainMapper<Long, List<Long>> inMapper); @Override List<Long> execute(final Long inRequest); }
ExcludeSelfMapperDecorator implements DomainMapper<Long, List<Long>> { @Override public List<Long> execute(final Long inRequest) { List<Long> fullList = mapper.execute(inRequest); if (fullList.isEmpty()) { return fullList; } else { List<Long> newList = new ArrayList<Long>(fullList.size()); for (Long id : fullList) { if (!id.equals(inRequest)) { newList.add(id); } } return newList; } } ExcludeSelfMapperDecorator(final DomainMapper<Long, List<Long>> inMapper); @Override List<Long> execute(final Long inRequest);  }