@Test public void taskOrderImmediate() { ArrayList<GapWorker.Task> list = new ArrayList<>(); list.add(new GapWorker.Task()); list.add(new GapWorker.Task()); list.add(new GapWorker.Task()); list.get(0).immediate = true; list.get(1).immediate = false; list.get(2).immediate = true; Collections.sort(list, GapWorker.sTaskComparator); assertTrue(list.get(0).immediate); assertTrue(list.get(1).immediate); assertFalse(list.get(2).immediate); }
public void add(RecyclerView recyclerView) { if (RecyclerView.DEBUG && mRecyclerViews.contains(recyclerView)) { throw new IllegalStateException("RecyclerView already present in worker list!"); } mRecyclerViews.add(recyclerView); }
GapWorker implements Runnable { public void add(RecyclerView recyclerView) { if (RecyclerView.DEBUG && mRecyclerViews.contains(recyclerView)) { throw new IllegalStateException("RecyclerView already present in worker list!"); } mRecyclerViews.add(recyclerView); } }
GapWorker implements Runnable { public void add(RecyclerView recyclerView) { if (RecyclerView.DEBUG && mRecyclerViews.contains(recyclerView)) { throw new IllegalStateException("RecyclerView already present in worker list!"); } mRecyclerViews.add(recyclerView); }  }
GapWorker implements Runnable { public void add(RecyclerView recyclerView) { if (RecyclerView.DEBUG && mRecyclerViews.contains(recyclerView)) { throw new IllegalStateException("RecyclerView already present in worker list!"); } mRecyclerViews.add(recyclerView); }  void add(RecyclerView recyclerView); void remove(RecyclerView recyclerView); @Override void run(); }
GapWorker implements Runnable { public void add(RecyclerView recyclerView) { if (RecyclerView.DEBUG && mRecyclerViews.contains(recyclerView)) { throw new IllegalStateException("RecyclerView already present in worker list!"); } mRecyclerViews.add(recyclerView); }  void add(RecyclerView recyclerView); void remove(RecyclerView recyclerView); @Override void run();  }