[BAEL-3392] Formatted code examples for [BAEL-3392]

This commit is contained in:
Martin van Wingerden
2019-11-01 09:05:12 +01:00
parent db85c8f275
commit 0e23f2e682
20519 changed files with 1642357 additions and 0 deletions
@@ -0,0 +1,21 @@
package com.baeldung.maths;
import org.junit.Assert;
import org.junit.Test;
import java.math.BigInteger;
public class BigIntegerImplUnitTest {
@Test
public void givenBigIntegerNumbers_whenAddedTogether_thenGetExpectedResult() {
BigInteger numStarsMilkyWay = new BigInteger("8731409320171337804361260816606476");
BigInteger numStarsAndromeda = new BigInteger("5379309320171337804361260816606476");
BigInteger totalStars = numStarsMilkyWay.add(numStarsAndromeda);
BigInteger result = new BigInteger("14110718640342675608722521633212952");
Assert.assertEquals(result, totalStars);
}
}