示例#1
0
 @Test
 public void foreach_A$Function1() throws Exception {
   String value = "vvv";
   Some<String> target = new Some<String>(value);
   target.foreach(
       new VoidF1<String>() {
         public void apply(String v1) {}
       });
 }
示例#2
0
 @Test
 public void foreach_A$VoidFunction1() throws Exception {
   final Flag flag = new Flag();
   int value = 1;
   Some<Integer> target = new Some<Integer>(value);
   target.foreach(
       new VoidF1<Integer>() {
         public void apply(Integer arg) {
           flag.toggle();
         }
       });
   assertTrue(flag.getValue());
 }