### Question:
FileSystemRegistry implements Iterable<FileSystem> { public FileSystem add(String[] segments, FileSystem fileSystem) { synchronized (lock) { val current = lookup(segments, true); val existing = current.value; current.value = fileSystem; registrySize++; return existing; } }  FileSystem add(String[] segments, FileSystem fileSystem); FileSystem add(@NonNull String key, @NonNull FileSystem fileSystem); int size(); @SuppressWarnings("PMD.NullAssignment") FileSystem remove(String[] segments); FileSystem remove(@NonNull String key); boolean contains(String[] key); boolean contains(String key); FileSystem get(@NonNull String key); FileSystem get(String[] segments); List<FileSystem> in(String key); List<FileSystem> in(String[] key); List<FileSystem> list(); @Override Iterator<FileSystem> iterator();  }### Answer:
@Test void ensureInsertingIntoRegistryWorks() { val fs = mock(FileSystem.class); assertNull(registry.add("com.whatever.bean", fs), "Added filesystem must not exist"); }