@Test void trySerializeShouldReturnString() { SerializableStringHolder value = new SerializableStringHolder("value"); String serializedString = "rO0ABXNyAERvcmcuYXBhY2hlLmphbWVzLnV0aWwuU2VyaWFsaXphdGlvblV0aWxUZXN0JFNlcmlhbGl6Y" + "WJsZVN0cmluZ0hvbGRlcjk393aULV9XAgABTAAFdmFsdWV0ABJMamF2YS9sYW5nL1N0cmluZzt4cHQABXZhbHVl"; String actual = serialize(value); assertThat(actual).isEqualTo(serializedString); }
public static String serialize(Serializable obj) { return Optional.ofNullable(obj) .map(SerializationUtils::serialize) .map(Base64.getEncoder()::encodeToString) .orElse(null); }
SerializationUtil { public static String serialize(Serializable obj) { return Optional.ofNullable(obj) .map(SerializationUtils::serialize) .map(Base64.getEncoder()::encodeToString) .orElse(null); } }
SerializationUtil { public static String serialize(Serializable obj) { return Optional.ofNullable(obj) .map(SerializationUtils::serialize) .map(Base64.getEncoder()::encodeToString) .orElse(null); }  }
SerializationUtil { public static String serialize(Serializable obj) { return Optional.ofNullable(obj) .map(SerializationUtils::serialize) .map(Base64.getEncoder()::encodeToString) .orElse(null); }  static String serialize(Serializable obj); static T deserialize(String object); }
SerializationUtil { public static String serialize(Serializable obj) { return Optional.ofNullable(obj) .map(SerializationUtils::serialize) .map(Base64.getEncoder()::encodeToString) .orElse(null); }  static String serialize(Serializable obj); static T deserialize(String object);  }