MCPcopy Create free account
hub / github.com/LFYSec/MScan / main

Method main

src/test/resources/pta/invokedynamic/Interface.java:11–44  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

9public class Interface {
10
11 public static void main(String[] args) {
12
13 // 1. Predicate: T -> boolean
14 Predicate<String> pre = "admin"::equals;
15 System.out.println(pre.test("manager"));
16
17 // 2. Consumer: T -> ()
18 Consumer<String> con = (String message) -> {
19 System.out.println("hello: " + message);
20 System.out.println("finished");
21 };
22 con.accept("guys");
23
24 // 3. Function: T -> R
25 Function<String, Integer> fun = (String gender) -> {
26 return "male".equals(gender) ? 1 : 0;
27 };
28 System.out.println(fun.apply("male"));
29
30 // 4. Supplier: () -> T (by get())
31 Supplier<String> sup = () -> UUID.randomUUID().toString();
32 System.out.println(sup.get());
33
34 // 5. UnaryOperator: T -> T
35 UnaryOperator<String> uo = (String img) -> {
36 img += "[100x200]";
37 return img;
38 };
39 System.out.println(uo.apply("origin graph"));
40
41 // 6. BinaryOperator: (T, T) -> T
42 BinaryOperator<Integer> bo = (Integer i1, Integer i2) -> i1 > i2 ? i1 : i2;
43 System.out.println(bo.apply(12, 13));
44 }
45}

Callers

nothing calls this directly

Calls 6

acceptMethod · 0.65
applyMethod · 0.65
toStringMethod · 0.65
getMethod · 0.65
testMethod · 0.45
equalsMethod · 0.45

Tested by

no test coverage detected