@Test void fromRawTextShouldThrowOnNull() { assertThatThrownBy(() -> Text.fromRawText(null)) .isInstanceOf(NullPointerException.class); }
public static Text fromRawText(String rawText) { Preconditions.checkNotNull(rawText); String trimmedText = rawText.trim(); Preconditions.checkArgument(!trimmedText.isEmpty(), "Text should not be empty"); return new Text(replaceLineBreaksByContinuation(trimmedText)); }
Text { public static Text fromRawText(String rawText) { Preconditions.checkNotNull(rawText); String trimmedText = rawText.trim(); Preconditions.checkArgument(!trimmedText.isEmpty(), "Text should not be empty"); return new Text(replaceLineBreaksByContinuation(trimmedText)); } }
Text { public static Text fromRawText(String rawText) { Preconditions.checkNotNull(rawText); String trimmedText = rawText.trim(); Preconditions.checkArgument(!trimmedText.isEmpty(), "Text should not be empty"); return new Text(replaceLineBreaksByContinuation(trimmedText)); } Text(String content); }
Text { public static Text fromRawText(String rawText) { Preconditions.checkNotNull(rawText); String trimmedText = rawText.trim(); Preconditions.checkArgument(!trimmedText.isEmpty(), "Text should not be empty"); return new Text(replaceLineBreaksByContinuation(trimmedText)); } Text(String content); static Text fromRawText(String rawText); String formatted(); @Override final boolean equals(Object o); @Override final int hashCode(); }
Text { public static Text fromRawText(String rawText) { Preconditions.checkNotNull(rawText); String trimmedText = rawText.trim(); Preconditions.checkArgument(!trimmedText.isEmpty(), "Text should not be empty"); return new Text(replaceLineBreaksByContinuation(trimmedText)); } Text(String content); static Text fromRawText(String rawText); String formatted(); @Override final boolean equals(Object o); @Override final int hashCode();  }