class InspectorTest { interface Stream { A[] toArray(IntFunction generator); } interface IntFunction { R apply(int value); } public static void main(Stream objectStream){ varargMethod(String[]::new, objectStream.toArray(String[]::new)); } public static void varargMethod(IntFunction generator,T[]... a){} }