示例#1
0
 @Test
 public void map_A$Function1() throws Exception {
   String value = "vvv";
   Some<String> target = new Some<String>(value);
   F1<String, String> f =
       new F1<String, String>() {
         @Override
         public String apply(String v1) {
           return v1;
         }
       };
   Option<String> actual = target.map(f);
   assertThat(actual.getOrNull(), is(equalTo("vvv")));
 }
示例#2
0
 @Test
 public void map_A$F1() throws Exception {
   String value = "vvv";
   Some<String> target = new Some<String>(value);
   F1<String, Integer> f =
       new F1<String, Integer>() {
         @Override
         public Integer apply(String v1) {
           return v1.length();
         }
       };
   Option<Integer> actual = target.map(f);
   assertThat(actual.getOrNull(), is(equalTo(3)));
 }