WorkflowList extends AbstractCollection<Workflow> implements ComponentLifecycle, ComponentLifecycleExtension, List<Workflow> { @Override public int lastIndexOf(Object o) { return workflows.lastIndexOf(o); } WorkflowList();  WorkflowList(Collection<Workflow> workflows); @Override void init(); @Override void start(); @Override void stop(); @Override void close(); @Override void prepare(); WorkflowLifecycleStrategy getLifecycleStrategy(); void setLifecycleStrategy(WorkflowLifecycleStrategy wls); List<Workflow> getWorkflows(); void setWorkflows(List<Workflow> l); void addWorkflow(Workflow element); @Override int size(); @Override Iterator<Workflow> iterator(); @Override boolean remove(Object o); boolean removeWorkflow(Workflow wf); @Override boolean add(Workflow element); @Override void add(int index, Workflow element); @Override boolean addAll(int index, Collection<? extends Workflow> c); @Override Workflow get(int index); Workflow getWorkflow(String uniqueId); @Override int indexOf(Object o); @Override int lastIndexOf(Object o); @Override void clear(); @Override ListIterator<Workflow> listIterator(); @Override ListIterator<Workflow> listIterator(int index); @Override Workflow remove(int index); @Override Workflow set(int index, Workflow element); @Override List<Workflow> subList(int fromIndex, int toIndex);  }
@Test public void testLastIndexOf() { WorkflowList list = new WorkflowList(); Workflow toAdd = createWorkflow(idGenerator.create(list)); list.add(createWorkflow(idGenerator.create(list))); list.add(createWorkflow(idGenerator.create(list))); list.add(toAdd); assertEquals(2, list.lastIndexOf(toAdd)); }