Merge branch 'master' into BAEL-4158

This commit is contained in:
Loredana Crusoveanu
2020-06-14 09:57:03 +03:00
committed by GitHub
381 changed files with 6905 additions and 596 deletions

View File

@@ -43,6 +43,17 @@ public class StringToIntOrIntegerUnitTest {
assertThat(result).isEqualTo(new Integer(42));
}
@Test
public void givenString_whenCallingValueOf_shouldCacheSomeValues() {
for (int i = -128; i <= 127; i++) {
String value = i + "";
Integer first = Integer.valueOf(value);
Integer second = Integer.valueOf(value);
assertThat(first).isSameAs(second);
}
}
@Test
public void givenString_whenCallingIntegerConstructor_shouldConvertToInt() {