### Question:
Versioned { public static <U> U valueOrElse(Versioned<U> versioned, U defaultValue) { return versioned == null ? defaultValue : versioned.value(); } Versioned(V value, long version, long creationTime);  Versioned(V value, long version); V value(); long version(); long creationTime(); synchronized Versioned<U> map(Function<V, U> transformer); static U valueOrElse(Versioned<U> versioned, U defaultValue); static U valueOrNull(Versioned<U> versioned); @Override int hashCode(); @Override boolean equals(Object other); @Override String toString();  }### Answer:
@Test public void testOrElse() { Versioned<String> vv = new Versioned<>("foo", 1); Versioned<String> nullVV = null; assertThat(Versioned.valueOrElse(vv, "bar"), is("foo")); assertThat(Versioned.valueOrElse(nullVV, "bar"), is("bar")); }