@Test public void testValidateLspCheckSum() throws Exception { result1 = calculator.validateLspCheckSum(l1Lsp, IsisConstants.CHECKSUMPOSITION, IsisConstants.CHECKSUMPOSITION + 1); assertThat(result1, is(true)); }
public boolean validateLspCheckSum(byte[] lspPacket, int lspChecksumPos1, int lspChecksumPos2) { byte[] checksum = calculateLspChecksum(lspPacket, lspChecksumPos1, lspChecksumPos2); if (lspPacket[lspChecksumPos1] == checksum[0] && lspPacket[lspChecksumPos2] == checksum[1]) { return true; } return false; }
ChecksumCalculator { public boolean validateLspCheckSum(byte[] lspPacket, int lspChecksumPos1, int lspChecksumPos2) { byte[] checksum = calculateLspChecksum(lspPacket, lspChecksumPos1, lspChecksumPos2); if (lspPacket[lspChecksumPos1] == checksum[0] && lspPacket[lspChecksumPos2] == checksum[1]) { return true; } return false; } }
ChecksumCalculator { public boolean validateLspCheckSum(byte[] lspPacket, int lspChecksumPos1, int lspChecksumPos2) { byte[] checksum = calculateLspChecksum(lspPacket, lspChecksumPos1, lspChecksumPos2); if (lspPacket[lspChecksumPos1] == checksum[0] && lspPacket[lspChecksumPos2] == checksum[1]) { return true; } return false; }  }
ChecksumCalculator { public boolean validateLspCheckSum(byte[] lspPacket, int lspChecksumPos1, int lspChecksumPos2) { byte[] checksum = calculateLspChecksum(lspPacket, lspChecksumPos1, lspChecksumPos2); if (lspPacket[lspChecksumPos1] == checksum[0] && lspPacket[lspChecksumPos2] == checksum[1]) { return true; } return false; }  boolean validateLspCheckSum(byte[] lspPacket, int lspChecksumPos1, int lspChecksumPos2); byte[] calculateLspChecksum(byte[] lspBytes, int lspChecksumPos1, int lspChecksumPos2); }
ChecksumCalculator { public boolean validateLspCheckSum(byte[] lspPacket, int lspChecksumPos1, int lspChecksumPos2) { byte[] checksum = calculateLspChecksum(lspPacket, lspChecksumPos1, lspChecksumPos2); if (lspPacket[lspChecksumPos1] == checksum[0] && lspPacket[lspChecksumPos2] == checksum[1]) { return true; } return false; }  boolean validateLspCheckSum(byte[] lspPacket, int lspChecksumPos1, int lspChecksumPos2); byte[] calculateLspChecksum(byte[] lspBytes, int lspChecksumPos1, int lspChecksumPos2);  }