NMEA { @NonNull static String[] splitNmea(@NonNull String nmea) { final int starIndex = nmea.lastIndexOf('*'); if (0 < starIndex && starIndex < nmea.length()) { nmea = nmea.substring(0, starIndex); } return nmea.split(",", -1); }    }
@Test public void splitNmea() { String[] split = {"$GPFOO", "0", "1", "2", "3"}; assertArrayEquals(split, NMEA.splitNmea("$GPFOO,0,1,2,3*99")); }