FlarmMessage { static public String checksum(String str) { int result = 0; for(int i = 0; i < str.length(); i++) { result ^= str.charAt(i); } return String.format("%02X", result); } FlarmMessage(AircraftBeacon aircraftBeacon); long getTime(); double getBearing(); float getDistance(); int getAlarmLevel(); int getRelativeNorth(); int getRelativeEast(); int getRelativeVertical(); int getIDType(); String getID(); int getTrack(); int getGroundSpeed(); float getClimbRate(); String getAcftType(); void setOwnLocation(Location ownLocation); static String checksum(String str); String toString();  }
@Test public void test_checksum() { String s = "PFLAA,0,1,80,-6,2,DDC10E,95,,37,2.3,8"; Assert.assertEquals("4E", FlarmMessage.checksum(s)); s = "PFLAA,0,-21,-49,-4,2,DDA659,0,,0,0.0,1"; Assert.assertEquals("07", FlarmMessage.checksum(s)); }