@Test public void testIndex() { BookmarkCollection c = new BookmarkCollection(new NullLocal("", "f")) { @Override protected void save(Host bookmark) { assertNotNull(bookmark.getUuid()); } }; final Host d = new Host(new TestProtocol(), "c"); final Host b = new Host(new TestProtocol(), "b"); final Host a = new Host(new TestProtocol(), "a"); c.add(a); c.add(b); assertEquals(a, c.get(0)); assertEquals(b, c.get(1)); c.add(0, d); assertEquals(d, c.get(0)); assertEquals(a, c.get(1)); assertEquals(b, c.get(2)); }
private void index() { IntStream.range(0, this.size()).forEach(i -> preferences.setProperty(toProperty(this.get(i), prefix), i)); }
BookmarkCollection extends MonitorFolderHostCollection { private void index() { IntStream.range(0, this.size()).forEach(i -> preferences.setProperty(toProperty(this.get(i), prefix), i)); } }
BookmarkCollection extends MonitorFolderHostCollection { private void index() { IntStream.range(0, this.size()).forEach(i -> preferences.setProperty(toProperty(this.get(i), prefix), i)); } BookmarkCollection(final Local f);  BookmarkCollection(final Local f, final String prefix); }
BookmarkCollection extends MonitorFolderHostCollection { private void index() { IntStream.range(0, this.size()).forEach(i -> preferences.setProperty(toProperty(this.get(i), prefix), i)); } BookmarkCollection(final Local f);  BookmarkCollection(final Local f, final String prefix); static BookmarkCollection defaultCollection(); @Override void collectionItemAdded(final Host bookmark); @Override void collectionItemRemoved(final Host bookmark); @Override void save(); @Override void sort(); }
BookmarkCollection extends MonitorFolderHostCollection { private void index() { IntStream.range(0, this.size()).forEach(i -> preferences.setProperty(toProperty(this.get(i), prefix), i)); } BookmarkCollection(final Local f);  BookmarkCollection(final Local f, final String prefix); static BookmarkCollection defaultCollection(); @Override void collectionItemAdded(final Host bookmark); @Override void collectionItemRemoved(final Host bookmark); @Override void save(); @Override void sort();  }