@Test public void taskOrderViewPresence() { ArrayList<GapWorker.Task> list = new ArrayList<>(); list.add(new GapWorker.Task()); list.add(new GapWorker.Task()); list.add(new GapWorker.Task()); list.get(0).view = null; list.get(1).view = new RecyclerView(getContext()); list.get(2).view = null; Collections.sort(list, GapWorker.sTaskComparator); assertNotNull(list.get(0).view); assertNull(list.get(1).view); assertNull(list.get(2).view); }
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();  }