### Question:
WebMapTileClient extends AbstractClient implements Client, Aggregate { public synchronized boolean checkForUpdates(Capabilities newCapabilities) { String currentUpdateSequence = null; AbstractCapabilitiesBase capas = this.capabilities; if (capas != null) { currentUpdateSequence = capas.getUpdateSequence(); } boolean changed = true; String newUpdateSequence = null; if (newCapabilities == null) { final GetCapabilitiesRequest getCaps = createGetCapabilities(); final Map<String, String> headerMap = getRequestHeaderMap(); getCaps.getHeaderMap().putAll(headerMap); getCaps.setUpdateSequence(currentUpdateSequence); try { newCapabilities = WMTSBindingUtilities.unmarshall(getCaps.getResponseStream(), getVersion()); } catch (Exception ex) { this.capabilities = null; try { LOGGER.log(Level.WARNING, "Wrong URL, the server doesn't answer : " + createGetCapabilities().getURL().toString(), ex); } catch (MalformedURLException ex1) { LOGGER.log(Level.WARNING, "Malformed URL, the server doesn't answer. ", ex1); } } } if (newCapabilities != null) { newUpdateSequence = newCapabilities.getUpdateSequence(); } changed = !Objects.equals(currentUpdateSequence, newUpdateSequence); if (changed) { this.capabilities = newCapabilities; } if (changed) { resources = createOrUpdateResources(resources, newCapabilities); } return changed; } WebMapTileClient(final URL serverURL, final String version);  WebMapTileClient(final URL serverURL, final ClientSecurity security, final WMTSVersion version);  WebMapTileClient(final URL serverURL, final WMTSVersion version);  WebMapTileClient(final URL serverURL, final String version, final Capabilities capabilities);  WebMapTileClient(final URL serverURL, final WMTSVersion version, final Capabilities capabilities);  WebMapTileClient(final URL serverURL, final ClientSecurity security,
            final WMTSVersion version, final Capabilities capabilities, boolean cacheImage);  WebMapTileClient(ParameterValueGroup param); @Override WMTSProvider getProvider(); Capabilities getServiceCapabilities(); Capabilities getCapabilities(final long timeout); synchronized boolean checkForUpdates(Capabilities newCapabilities); WMTSVersion getVersion(); boolean getImageCache(); GetTileRequest createGetTile(); GetCapabilitiesRequest createGetCapabilities(); Map<String,String> getRequestHeaderMap(); @Override synchronized Collection<WMTSResource> components(); @Override void close();  }### Answer:
@Test public void testUpdateSequence() throws MalformedURLException, JAXBException, DataStoreException, FactoryException { Capabilities capa1 = WMTSBindingUtilities.unmarshall(WebMapTileClientTest.class.getResource("/org/geotoolkit/wmts/UpdateSequence1.xml"), WMTSVersion.v100); Capabilities capa2 = WMTSBindingUtilities.unmarshall(WebMapTileClientTest.class.getResource("/org/geotoolkit/wmts/UpdateSequence2.xml"), WMTSVersion.v100); final WebMapTileClient wmts = new WebMapTileClient(new URL("http: final GridCoverageResource resource = (GridCoverageResource) wmts.findResource("PROFONDEUR_RGB_pyramid"); final AtomicBoolean updated = new AtomicBoolean(false); resource.addListener(StoreEvent.class, new StoreListener<StoreEvent>() { @Override public void eventOccured(StoreEvent event) { updated.set(true); } }); Assert.assertEquals(CommonCRS.WGS84.normalizedGeographic(), resource.getGridGeometry().getCoordinateReferenceSystem()); Assert.assertEquals(false, updated.get()); wmts.checkForUpdates(capa2); Assert.assertEquals(true, updated.get()); Assert.assertEquals(CommonCRS.NAD83.normalizedGeographic(), resource.getGridGeometry().getCoordinateReferenceSystem()); }