Use static import of nothing()
This commit is contained in:
parent
e711184628
commit
dc89a0962f
1 changed files with 2 additions and 2 deletions
|
@ -71,14 +71,14 @@ public class MaybeTest {
|
||||||
@Test
|
@Test
|
||||||
public void toOptional() {
|
public void toOptional() {
|
||||||
assertThat(just(1).toOptional()).isEqualTo(Optional.of(1));
|
assertThat(just(1).toOptional()).isEqualTo(Optional.of(1));
|
||||||
assertThat(Maybe.nothing()
|
assertThat(nothing()
|
||||||
.toOptional()).isEqualTo(Optional.empty());
|
.toOptional()).isEqualTo(Optional.empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void fromOptional() {
|
public void fromOptional() {
|
||||||
assertThat(Maybe.fromOptional(Optional.of(1))).isEqualTo(just(1));
|
assertThat(Maybe.fromOptional(Optional.of(1))).isEqualTo(just(1));
|
||||||
assertThat(Maybe.fromOptional(Optional.empty())).isEqualTo(Maybe.nothing());
|
assertThat(Maybe.fromOptional(Optional.empty())).isEqualTo(nothing());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue