### Question:
NmeaSentence { public boolean isLocationSentence(){ return isGSA() || isGGA(); } NmeaSentence(String nmeaSentence); boolean isLocationSentence(); String getLatestPdop(); String getLatestVdop(); String getLatestHdop(); String getGeoIdHeight(); String getAgeOfDgpsData(); String getDgpsId();  }### Answer:
@Test public void NmeaSentence_CheckForRelevantSentence(){ NmeaSentence nmeaSentence = new NmeaSentence(null); assertThat("Null NMEA is not a valid location", nmeaSentence.isLocationSentence(), is(false)); nmeaSentence = new NmeaSentence("$GPGGA,123519,4807.038,N,01131.000,E,1,08,0.9,545"); assertThat("GPGGA is a valid location", nmeaSentence.isLocationSentence(), is(true)); nmeaSentence = new NmeaSentence("$GPGSA,A,3,04,05,,09,12,,,24,,,,,2.5,1.3,2.1*39"); assertThat("GPGSA is a valid location", nmeaSentence.isLocationSentence(), is(true)); }
@Test public void NmeaSentence_WhenGNSS_IsValidSentence(){ NmeaSentence nmeaSentence = new NmeaSentence("$GNGGA,095556.857,3454.932,N,07502.500,W,0,00,0.3,,M,,M,,*69"); assertThat("GNSS GNGGA is a valid sentence", nmeaSentence.isLocationSentence(), is(true)); }
@Test public void NmeaSentence_WhenGlonass_IsValidSentence(){ NmeaSentence nmeaSentence = new NmeaSentence("$GLGGA,095556.857,3454.932,N,07502.500,W,0,00,0.3,,M,,M,,*6B"); assertThat("Glonass GLGGA is a valid sentence", nmeaSentence.isLocationSentence(), is(true)); }
@Test public void NmeaSentence_WhenGalileo_IsValidSentence(){ NmeaSentence nmeaSentence = new NmeaSentence("$GAGGA,095556.857,3454.932,N,07502.500,W,0,00,0.3,,M,,M,,*66"); assertThat("Galileo GAGGA is a valid sentence", nmeaSentence.isLocationSentence(), is(true)); }