@Test public void nonEmptyString() { NonEmptyString nonEmptyString = NonEmptyString.of("hola mundo"); assertAll( () -> assertThrows(IllegalArgumentException.class, () -> NonEmptyString.of(null)), () -> assertThrows(IllegalArgumentException.class, () -> NonEmptyString.of("")), () -> assertDoesNotThrow(() -> NonEmptyString.of("hola mundo")), () -> assertEquals("hola mundo", nonEmptyString.get()), () -> assertEquals("HOLA MUNDO", nonEmptyString.transform(String::toUpperCase)), () -> assertEquals(NonEmptyString.of("HOLA MUNDO"), nonEmptyString.map(String::toUpperCase)), () -> assertEquals(NonEmptyString.of("hola mundo"), NonEmptyString.of("hola mundo")) ); }
private NonEmptyString(String value) { this.value = value; }
NonEmptyString implements Serializable { private NonEmptyString(String value) { this.value = value; } }
NonEmptyString implements Serializable { private NonEmptyString(String value) { this.value = value; } private  NonEmptyString(String value); }
NonEmptyString implements Serializable { private NonEmptyString(String value) { this.value = value; } private  NonEmptyString(String value); NonEmptyString map(Operator1<String> mapper); T transform(Function1<String, T> mapper); String get(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString(); static NonEmptyString of(String value); }
NonEmptyString implements Serializable { private NonEmptyString(String value) { this.value = value; } private  NonEmptyString(String value); NonEmptyString map(Operator1<String> mapper); T transform(Function1<String, T> mapper); String get(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString(); static NonEmptyString of(String value);  }