import java.util.ArrayList ;
import java.util.Arrays ;
import java.util.Collection ;
import java.util.List ;
interface Callback< T> {
void call( T t) ;
}
class ConcreteCallback implements Callback< Collection< Object>> {
public void call( final Collection< Object> data) {
}
}
}
public class Main {
private static < T> void call( final List< T> data, final Callback<? super List<? super T>> cb) {
ArrayList< T> dat = new ArrayList<> ( ) ;
for ( T object: data) {
dat.add ( object) ;
}
cb.call ( dat) ;
}
public static void main
( final String ...
args ) { call
( Arrays .
asList ( args
) ,
new ConcreteCallback
( ) ) ; }
}
aW1wb3J0IGphdmEudXRpbC5BcnJheUxpc3Q7CmltcG9ydCBqYXZhLnV0aWwuQXJyYXlzOwppbXBvcnQgamF2YS51dGlsLkNvbGxlY3Rpb247CmltcG9ydCBqYXZhLnV0aWwuTGlzdDsKCmludGVyZmFjZSBDYWxsYmFjazxUPiB7CiAgICB2b2lkIGNhbGwoVCB0KTsKfQoKY2xhc3MgQ29uY3JldGVDYWxsYmFjayBpbXBsZW1lbnRzIENhbGxiYWNrPENvbGxlY3Rpb248T2JqZWN0Pj4gewogICAgcHVibGljIHZvaWQgY2FsbChmaW5hbCBDb2xsZWN0aW9uPE9iamVjdD4gZGF0YSkgewogICAgICAgIGZvciAoT2JqZWN0IG9iajogZGF0YSkgewogICAgICAgICAgICBTeXN0ZW0ub3V0LnByaW50bG4ob2JqKTsKICAgICAgICB9CiAgICB9Cn0KCnB1YmxpYyBjbGFzcyBNYWluIHsKICAgIHByaXZhdGUgc3RhdGljIDxUPiB2b2lkIGNhbGwoZmluYWwgTGlzdDxUPiBkYXRhLCBmaW5hbCBDYWxsYmFjazw/IHN1cGVyIExpc3Q8PyBzdXBlciBUPj4gY2IpIHsKICAgICAgICBBcnJheUxpc3Q8VD4gZGF0ID0gbmV3IEFycmF5TGlzdDw+KCk7CiAgICAgICAgZm9yIChUIG9iamVjdDogZGF0YSkgewogICAgICAgICAgICBkYXQuYWRkKG9iamVjdCk7CiAgICAgICAgfQogICAgICAgIGNiLmNhbGwoZGF0KTsKICAgIH0KCiAgICBwdWJsaWMgc3RhdGljIHZvaWQgbWFpbihmaW5hbCBTdHJpbmcuLi4gYXJncykgewogICAgICAgIGNhbGwoQXJyYXlzLmFzTGlzdChhcmdzKSwgbmV3IENvbmNyZXRlQ2FsbGJhY2soKSk7CiAgICB9Cn0=
compilation info
Main.java:28: error: method call in class Main cannot be applied to given types;
call(Arrays.asList(args), new ConcreteCallback());
^
required: List<T>,Callback<? super List<? super T>>
found: List<String>,ConcreteCallback
reason: no instance(s) of type variable(s) T exist so that argument type ConcreteCallback conforms to formal parameter type Callback<? super List<? super T>>
where T is a type-variable:
T extends Object declared in method <T>call(List<T>,Callback<? super List<? super T>>)
1 error
stdout