@Test(expected = IllegalArgumentException.class) public void testSubListIllegalArgument() { GroupConfigEntryList list = new GroupConfigEntryList(); list.subList(2, 1); }
public List<GroupConfigEntry> subList(int fromIndex, int toIndex) { if (fromIndex > toIndex) { throw new IllegalArgumentException("from index > to index"); } return entries.stream() .filter(e -> e.getIndex() >= fromIndex && e.getIndex() < toIndex) .collect(Collectors.toList()); }
GroupConfigEntryList implements Iterable<GroupConfigEntry> { public List<GroupConfigEntry> subList(int fromIndex, int toIndex) { if (fromIndex > toIndex) { throw new IllegalArgumentException("from index > to index"); } return entries.stream() .filter(e -> e.getIndex() >= fromIndex && e.getIndex() < toIndex) .collect(Collectors.toList()); } }
GroupConfigEntryList implements Iterable<GroupConfigEntry> { public List<GroupConfigEntry> subList(int fromIndex, int toIndex) { if (fromIndex > toIndex) { throw new IllegalArgumentException("from index > to index"); } return entries.stream() .filter(e -> e.getIndex() >= fromIndex && e.getIndex() < toIndex) .collect(Collectors.toList()); }  }
GroupConfigEntryList implements Iterable<GroupConfigEntry> { public List<GroupConfigEntry> subList(int fromIndex, int toIndex) { if (fromIndex > toIndex) { throw new IllegalArgumentException("from index > to index"); } return entries.stream() .filter(e -> e.getIndex() >= fromIndex && e.getIndex() < toIndex) .collect(Collectors.toList()); }  GroupConfigEntry getLast(); void add(GroupConfigEntry entry); GroupConfigEntry removeAfter(int entryIndex); List<GroupConfigEntry> subList(int fromIndex, int toIndex); @Override @Nonnull Iterator<GroupConfigEntry> iterator(); @Override String toString(); }
GroupConfigEntryList implements Iterable<GroupConfigEntry> { public List<GroupConfigEntry> subList(int fromIndex, int toIndex) { if (fromIndex > toIndex) { throw new IllegalArgumentException("from index > to index"); } return entries.stream() .filter(e -> e.getIndex() >= fromIndex && e.getIndex() < toIndex) .collect(Collectors.toList()); }  GroupConfigEntry getLast(); void add(GroupConfigEntry entry); GroupConfigEntry removeAfter(int entryIndex); List<GroupConfigEntry> subList(int fromIndex, int toIndex); @Override @Nonnull Iterator<GroupConfigEntry> iterator(); @Override String toString();  }