@Test public void testValidateLsaCheckSum() throws Exception { assertThat(checksumCalculator.validateLsaCheckSum(rlsa, lsaChecksumPos1, lsaChecksumPos2), is(true)); }
public boolean validateLsaCheckSum(byte[] lsaPacket, int lsaChecksumPos1, int lsaChecksumPos2) { byte[] checksum = calculateLsaChecksum(lsaPacket, lsaChecksumPos1, lsaChecksumPos2); if (lsaPacket[lsaChecksumPos1] == checksum[0] && lsaPacket[lsaChecksumPos2] == checksum[1]) { return true; } return false; }
ChecksumCalculator { public boolean validateLsaCheckSum(byte[] lsaPacket, int lsaChecksumPos1, int lsaChecksumPos2) { byte[] checksum = calculateLsaChecksum(lsaPacket, lsaChecksumPos1, lsaChecksumPos2); if (lsaPacket[lsaChecksumPos1] == checksum[0] && lsaPacket[lsaChecksumPos2] == checksum[1]) { return true; } return false; } }
ChecksumCalculator { public boolean validateLsaCheckSum(byte[] lsaPacket, int lsaChecksumPos1, int lsaChecksumPos2) { byte[] checksum = calculateLsaChecksum(lsaPacket, lsaChecksumPos1, lsaChecksumPos2); if (lsaPacket[lsaChecksumPos1] == checksum[0] && lsaPacket[lsaChecksumPos2] == checksum[1]) { return true; } return false; }  }
ChecksumCalculator { public boolean validateLsaCheckSum(byte[] lsaPacket, int lsaChecksumPos1, int lsaChecksumPos2) { byte[] checksum = calculateLsaChecksum(lsaPacket, lsaChecksumPos1, lsaChecksumPos2); if (lsaPacket[lsaChecksumPos1] == checksum[0] && lsaPacket[lsaChecksumPos2] == checksum[1]) { return true; } return false; }  static int convertToSixteenBits(String strToConvert); boolean isValidOspfCheckSum(OspfMessage ospfMessage, int checksumPos1, int checksumPos2); boolean isValidLsaCheckSum(OspfLsa ospfLsa, int lsType, int lsaChecksumPos1,
                                      int lsaChecksumPos2); boolean validateLsaCheckSum(byte[] lsaPacket, int lsaChecksumPos1, int lsaChecksumPos2); boolean validateOspfCheckSum(byte[] ospfPacket, int checksumPos1, int checksumPos2); byte[] calculateLsaChecksum(byte[] lsaBytes, int lsaChecksumPos1, int lsaChecksumPos2); byte[] calculateOspfCheckSum(byte[] packet, int checksumPos1, int checksumPos2); }
ChecksumCalculator { public boolean validateLsaCheckSum(byte[] lsaPacket, int lsaChecksumPos1, int lsaChecksumPos2) { byte[] checksum = calculateLsaChecksum(lsaPacket, lsaChecksumPos1, lsaChecksumPos2); if (lsaPacket[lsaChecksumPos1] == checksum[0] && lsaPacket[lsaChecksumPos2] == checksum[1]) { return true; } return false; }  static int convertToSixteenBits(String strToConvert); boolean isValidOspfCheckSum(OspfMessage ospfMessage, int checksumPos1, int checksumPos2); boolean isValidLsaCheckSum(OspfLsa ospfLsa, int lsType, int lsaChecksumPos1,
                                      int lsaChecksumPos2); boolean validateLsaCheckSum(byte[] lsaPacket, int lsaChecksumPos1, int lsaChecksumPos2); boolean validateOspfCheckSum(byte[] ospfPacket, int checksumPos1, int checksumPos2); byte[] calculateLsaChecksum(byte[] lsaBytes, int lsaChecksumPos1, int lsaChecksumPos2); byte[] calculateOspfCheckSum(byte[] packet, int checksumPos1, int checksumPos2);  }