| Class | Line # | Actions | |||
|---|---|---|---|---|---|
| ScopeFunctions | 6 | 3 | 3 |
| 1 | package jalview.testutils; | |
| 2 | ||
| 3 | import java.util.function.Consumer; | |
| 4 | import java.util.function.Supplier; | |
| 5 | ||
| 6 | public class ScopeFunctions | |
| 7 | { | |
| 8 | 0 | private ScopeFunctions() {} |
| 9 | ||
| 10 | 0 | public static <R> R supply(Supplier<? extends R> func) |
| 11 | { | |
| 12 | 0 | return func.get(); |
| 13 | } | |
| 14 | ||
| 15 | 8 | public static <T> T apply(T context, Consumer<? super T> func) |
| 16 | { | |
| 17 | 8 | func.accept(context); |
| 18 | 8 | return context; |
| 19 | } | |
| 20 | } |