### Question:
SensorNames { public static String getBasename(String sensorName) { final String standardName = getStandardName(sensorName); final int dotIndex = standardName.indexOf("."); final String basename; if (dotIndex == -1) { basename = standardName; } else { basename = standardName.substring(0, dotIndex); } return basename; } private  SensorNames(); static String getOrbitName(String sensorName); static String getStandardName(String sensorName); static String getBasename(String sensorName); static String getDimensionNameX(String sensorName); static String getDimensionNameY(String sensorName); static boolean isOrbitName(String sensorName); static boolean isStandardName(String sensorName);  }### Answer:
@Test public void testGetBasename() throws Exception { assertEquals("atsr", SensorNames.getBasename("atsr.1")); assertEquals("atsr", SensorNames.getBasename("atsr.2")); assertEquals("atsr", SensorNames.getBasename("atsr.3")); assertEquals("atsr", SensorNames.getBasename("orb_atsr.1")); assertEquals("atsr", SensorNames.getBasename("orb_atsr.2")); assertEquals("atsr", SensorNames.getBasename("orb_atsr.3")); assertEquals("avhrr", SensorNames.getBasename("orb_avhrr.n10")); assertEquals("avhrr", SensorNames.getBasename("orb_avhrr.m01")); assertEquals("avhrr", SensorNames.getBasename("orb_avhrr.m02")); assertEquals("avhrr_f", SensorNames.getBasename("orb_avhrr_f.m01")); assertEquals("avhrr_f", SensorNames.getBasename("orb_avhrr_f.m02")); assertEquals("amsr2", SensorNames.getBasename("orb_amsr2")); try { SensorNames.getBasename("orb_avhrr.m01f"); fail(); } catch (IllegalArgumentException expected) { } try { SensorNames.getBasename("orb_avhrr.m02f"); fail(); } catch (IllegalArgumentException expected) { } try { SensorNames.getBasename("aai"); fail(); } catch (IllegalArgumentException expected) { } try { SensorNames.getBasename("seaice"); fail(); } catch (IllegalArgumentException expected) { } }