### Question:
FileSystemStorage extends Configured implements Storage { @Override public boolean isIdentical(Storage toCompareAgainst) throws FalconException { if (!(toCompareAgainst instanceof FileSystemStorage)) { return false; } FileSystemStorage fsStorage = (FileSystemStorage) toCompareAgainst; final List<Location> fsStorageLocations = fsStorage.getLocations(); return getLocations().size() == fsStorageLocations.size() && StringUtils.equals(getUriTemplate(LocationType.DATA, getLocations()), getUriTemplate(LocationType.DATA, fsStorageLocations)) && StringUtils.equals(getUriTemplate(LocationType.STATS, getLocations()), getUriTemplate(LocationType.STATS, fsStorageLocations)) && StringUtils.equals(getUriTemplate(LocationType.META, getLocations()), getUriTemplate(LocationType.META, fsStorageLocations)) && StringUtils.equals(getUriTemplate(LocationType.TMP, getLocations()), getUriTemplate(LocationType.TMP, fsStorageLocations)); } FileSystemStorage(Feed feed); protected  FileSystemStorage(String storageUrl, Locations locations); protected  FileSystemStorage(String storageUrl, List<Location> locations); protected  FileSystemStorage(String uriTemplate); @Override TYPE getType(); String getStorageUrl(); List<Location> getLocations(); @Override String getUriTemplate(); @Override String getUriTemplate(LocationType locationType); String getUriTemplate(LocationType locationType, List<Location> locationList); Path getWorkingDir(); @Override boolean isIdentical(Storage toCompareAgainst); static Location getLocation(List<Location> locations, LocationType type); @Override void validateACL(AccessControlList acl); @Override StringBuilder evict(String retentionLimit, String timeZone, Path logFilePath); @Override @SuppressWarnings("MagicConstant") List<FeedInstanceStatus> getListing(Feed feed, String clusterName, LocationType locationType,
                                               Date start, Date end); @Override FeedInstanceStatus.AvailabilityStatus getInstanceAvailabilityStatus(Feed feed, String clusterName,
                                                                   LocationType locationType,
                                                                   Date instanceTime); FileStatus getFileStatus(FileSystem fileSystem, Path feedInstancePath); Configuration getConf(); @Override String toString(); static final String FEED_PATH_SEP; static final String LOCATION_TYPE_SEP; static final String FILE_SYSTEM_URL; }### Answer:
@Test public void testIsIdentical() throws Exception { final String storageUrl = "jail: final Location location1 = new Location(); location1.setPath("/foo/bar"); location1.setType(LocationType.DATA); List<Location> locations1 = new ArrayList<Location>(); locations1.add(location1); FileSystemStorage storage1 = new FileSystemStorage(storageUrl, locations1); final Location location2 = new Location(); location2.setPath("/foo/bar"); location2.setType(LocationType.DATA); List<Location> locations2 = new ArrayList<Location>(); locations2.add(location2); FileSystemStorage storage2 = new FileSystemStorage(storageUrl, locations2); Assert.assertTrue(storage1.isIdentical(storage2)); }
@Test public void testIsIdenticalNegative() throws Exception { final String storageUrl = "jail: final Location location1 = new Location(); location1.setPath("/foo/baz"); location1.setType(LocationType.DATA); List<Location> locations1 = new ArrayList<Location>(); locations1.add(location1); FileSystemStorage storage1 = new FileSystemStorage(storageUrl, locations1); final Location location2 = new Location(); location2.setPath("/foo/bar"); location2.setType(LocationType.DATA); List<Location> locations2 = new ArrayList<Location>(); locations2.add(location2); FileSystemStorage storage2 = new FileSystemStorage(storageUrl, locations2); Assert.assertFalse(storage1.isIdentical(storage2)); }