This commit is contained in:
2022-06-09 01:18:23 -04:00
parent 4f1cdf5208
commit aade7b9c56
29 changed files with 116 additions and 32 deletions
@@ -1,4 +1,4 @@
package com.baeldung.java9.compactstring;
package com.ossez.java9.compactstring;
import java.util.List;
import java.util.stream.IntStream;
@@ -1,4 +1,4 @@
package com.baeldung.localization;
package com.ossez.localization;
import java.text.ParseException;
import java.util.Arrays;
@@ -1,4 +1,4 @@
package com.baeldung.localization;
package com.ossez.localization;
import com.ibm.icu.text.MessageFormat;
@@ -1,4 +1,4 @@
package com.baeldung.localization;
package com.ossez.localization;
import java.text.MessageFormat;
import java.util.Date;
@@ -1,4 +1,4 @@
package com.baeldung.localization;
package com.ossez.localization;
import java.util.List;
import java.util.Locale;
@@ -1,7 +1,8 @@
package com.baeldung.multiline;
package com.ossez.multiline;
import com.google.common.base.Joiner;
import com.google.common.collect.ImmutableList;
import org.apache.commons.lang3.StringUtils;
import java.io.IOException;
import java.io.PrintWriter;
@@ -65,10 +66,11 @@ public class MultiLineString {
}
public String textBlocks() {
return """
Get busy living
or
get busy dying.
--Stephen King""";
// return """
// Get busy living
// or
// get busy dying.
// --Stephen King""";
return StringUtils.EMPTY;
}
}
@@ -1,4 +1,4 @@
package com.baeldung.stringperformance;
package com.ossez.stringperformance;
import com.google.common.base.Splitter;
import org.apache.commons.lang3.StringUtils;
@@ -1,4 +1,4 @@
package com.baeldung.interview;
package com.ossez.interview;
import org.junit.Test;
@@ -0,0 +1,27 @@
package com.ossez.interview;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.junit.Test;
import java.util.Objects;
import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
import static org.assertj.core.api.AssertionsForClassTypes.assertThatExceptionOfType;
public class StringNullCheckUnitTest {
@Test
public void toString_null_safe() {
Object obj = null;
ObjectUtils.toString(obj, StringUtils.EMPTY);
ObjectUtils.toString(obj, ()->StringUtils.EMPTY);
assertThat("null").isEqualTo(Objects.toString(obj));
assertThat("").isEqualTo(Objects.toString(obj,StringUtils.EMPTY));
assertThatExceptionOfType(NullPointerException.class).isThrownBy(() ->{
obj.toString();
});
}
}
@@ -1,4 +1,4 @@
package com.baeldung.interview;
package com.ossez.interview;
import org.apache.commons.lang3.StringUtils;
import org.junit.Test;
@@ -1,4 +1,4 @@
package com.baeldung.localization;
package com.ossez.localization;
import org.junit.Test;
@@ -1,4 +1,4 @@
package com.baeldung.randomstrings;
package com.ossez.randomstrings;
import org.apache.commons.lang3.RandomStringUtils;
import org.junit.Test;
@@ -1,4 +1,4 @@
package com.baeldung.stringnotempty;
package com.ossez.stringnotempty;
import com.google.common.base.Strings;
import org.apache.commons.lang3.StringUtils;
@@ -1,4 +1,4 @@
package com.baeldung.stringpool;
package com.ossez.stringpool;
import static org.assertj.core.api.Assertions.assertThat;
@@ -1,4 +1,4 @@
package com.baeldung.stringtoolong;
package com.ossez.stringtoolong;
import static org.assertj.core.api.Assertions.assertThat;