### Question:
Insitu_CCI_2_Accessor implements InsituAccessor { static String extractWMOID(DataFile dataFile) { final String path = dataFile.getPath(); final int wmoidTagStart = path.indexOf(WMOID_TAG); if (wmoidTagStart < 0) { return null; } final String wmoidPart = path.substring(wmoidTagStart + WMOID_TAG.length()); final Matcher matcher = WMOID_PATTERN.matcher(wmoidPart); final boolean found = matcher.find(); if (!found) { return null; } final int wmoidEnd = matcher.start(); return wmoidPart.substring(0, wmoidEnd); } Insitu_CCI_2_Accessor(NetcdfReader netcdfReader); @Override void readHistoryTimes(); @Override Date getHistoryStart(); @Override Date getHistoryEnd(); @Override String getObservationName(); @Override double getStartLon(); @Override double getEndLon(); @Override double getStartLat(); @Override double getEndLat(); @Override Range findExtractionRange(Date refTime, int halfExtractDurationInSeconds); @Override List<Range> createSubsampling(Range range, int maxLength); @Override List<SamplingPoint> readSamplingPoints(); @Override Variable getVariable(String role); @Override void scaleTime(Array timeArray);  }### Answer:
@Test public void testExtractWMOID() { DataFile dataFile = createDataFile("/usr/local/data/test/insitu_0_WMOID_71569_20030117_20030131.nc"); assertEquals("71569", Insitu_CCI_2_Accessor.extractWMOID(dataFile)); dataFile = createDataFile("C:\\Toms\\Data\\SST\\insitu_5_WMOID_7900016_20030110_20030130.nc"); assertEquals("7900016", Insitu_CCI_2_Accessor.extractWMOID(dataFile)); dataFile = createDataFile("insitu_4_WMOID_TGT_C2_03_20031224_20031231.nc"); assertEquals("TGT_C2_03", Insitu_CCI_2_Accessor.extractWMOID(dataFile)); dataFile = createDataFile("insitu_4_WMOID_99999999_20031224_20031231.nc"); assertEquals("99999999", Insitu_CCI_2_Accessor.extractWMOID(dataFile)); dataFile = createDataFile("C:\\Toms\\Data\\SST\\contains_no_WMO_ID.nc"); assertNull(Insitu_CCI_2_Accessor.extractWMOID(dataFile)); dataFile = createDataFile("C:\\Toms\\Data\\SST\\WMOID_does_not_match_any_numerical_pattern.nc"); assertNull(Insitu_CCI_2_Accessor.extractWMOID(dataFile)); }