@Test public void test() { ExcludeItemsTrimmer sut = new ExcludeItemsTrimmer(Arrays.asList(1L, 7L, 4L)); List<Long> ids = sut.trim(Arrays.asList(9L, 8L, 7L, 6L, 5L, 4L, 3L, 2L, 1L), null); assertEquals(6, ids.size()); assertEquals((Long) 9L, ids.get(0)); assertEquals((Long) 8L, ids.get(1)); assertEquals((Long) 6L, ids.get(2)); assertEquals((Long) 5L, ids.get(3)); assertEquals((Long) 3L, ids.get(4)); assertEquals((Long) 2L, ids.get(5)); }
@Override public List<Long> trim(final List<Long> inIds, final Long inUserPersonId) { List<Long> newIds = new ArrayList<Long>(inIds.size()); for (Long id : inIds) { if (!idsToExclude.contains(id)) { newIds.add(id); } } return newIds; }
ExcludeItemsTrimmer implements ListTrimmer { @Override public List<Long> trim(final List<Long> inIds, final Long inUserPersonId) { List<Long> newIds = new ArrayList<Long>(inIds.size()); for (Long id : inIds) { if (!idsToExclude.contains(id)) { newIds.add(id); } } return newIds; } }
ExcludeItemsTrimmer implements ListTrimmer { @Override public List<Long> trim(final List<Long> inIds, final Long inUserPersonId) { List<Long> newIds = new ArrayList<Long>(inIds.size()); for (Long id : inIds) { if (!idsToExclude.contains(id)) { newIds.add(id); } } return newIds; } ExcludeItemsTrimmer(final List<Long> inIdsToExclude); }
ExcludeItemsTrimmer implements ListTrimmer { @Override public List<Long> trim(final List<Long> inIds, final Long inUserPersonId) { List<Long> newIds = new ArrayList<Long>(inIds.size()); for (Long id : inIds) { if (!idsToExclude.contains(id)) { newIds.add(id); } } return newIds; } ExcludeItemsTrimmer(final List<Long> inIdsToExclude); @Override List<Long> trim(final List<Long> inIds, final Long inUserPersonId); }
ExcludeItemsTrimmer implements ListTrimmer { @Override public List<Long> trim(final List<Long> inIds, final Long inUserPersonId) { List<Long> newIds = new ArrayList<Long>(inIds.size()); for (Long id : inIds) { if (!idsToExclude.contains(id)) { newIds.add(id); } } return newIds; } ExcludeItemsTrimmer(final List<Long> inIdsToExclude); @Override List<Long> trim(final List<Long> inIds, final Long inUserPersonId);  }