### Question:
BufferedFileBackedSortedSet implements SortedSet<E> { @Override public int size() { if (sizeModified) { this.size = set.size(); sizeModified = false; } return this.size; } BufferedFileBackedSortedSet(BufferedFileBackedSortedSet<E> other);  BufferedFileBackedSortedSet(List<SortedSetFileHandlerFactory> handlerFactories);  BufferedFileBackedSortedSet(List<SortedSetFileHandlerFactory> handlerFactories, FileSortedSet.FileSortedSetFactory<E> setFactory);  BufferedFileBackedSortedSet(Comparator<? super E> comparator, List<SortedSetFileHandlerFactory> handlerFactories);  BufferedFileBackedSortedSet(Comparator<? super E> comparator, List<SortedSetFileHandlerFactory> handlerFactories,
                    FileSortedSet.FileSortedSetFactory<E> setFactory);  BufferedFileBackedSortedSet(Comparator<? super E> comparator, int bufferPersistThreshold, int maxOpenFiles, int numRetries,
                    List<SortedSetFileHandlerFactory> handlerFactories);  BufferedFileBackedSortedSet(Comparator<? super E> comparator, int bufferPersistThreshold, int maxOpenFiles, int numRetries,
                    List<SortedSetFileHandlerFactory> handlerFactories, FileSortedSet.FileSortedSetFactory<E> setFactory); void persist(); boolean hasPersistedData(); boolean isPersisted(); @Override int size(); int getBufferPersistThreshold(); int getBufferSize(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override boolean containsAll(Collection<?> c); @Override Iterator<E> iterator(); void compact(int maxFiles); @Override Object[] toArray(); @Override T[] toArray(T[] a); @Override boolean add(E e); @Override boolean addAll(Collection<? extends E> c); @Override boolean remove(Object o); @Override boolean retainAll(Collection<?> c); @Override boolean removeAll(Collection<?> c); @Override void clear(); @Override Comparator<? super E> comparator(); @Override SortedSet<E> subSet(E fromElement, E toElement); @Override SortedSet<E> headSet(E toElement); @Override SortedSet<E> tailSet(E fromElement); @Override E first(); @Override E last();  }### Answer:
@Test public void testSize() { int expectedSize = data.length; assertEquals(expectedSize, set.size()); for (int i = (data.length / 2); i < data.length; i++) { set.remove(data[i]); expectedSize--; assertEquals(expectedSize, set.size()); } for (int i = 0; i < (data.length / 2); i++) { set.remove(data[i]); expectedSize--; assertEquals(expectedSize, set.size()); } assertEquals(0, set.size()); for (int i = 0; i < data.length; i++) { set.add(data[i]); expectedSize++; assertEquals(expectedSize, set.size()); } }