このメソッドで@SuppressWarnings( "unchecked")を削除するにはどうすればよいですか?
@SuppressWarnings("unchecked")
public <T> Worker<T> findSimilarWorker(Worker<T> worker) {
// The variable workers is a Set<Worker<?>>
for(Worker<?> w : workers) {
// The following line is unchecked cast
if(w.isSimilar(worker)) return (Worker<T>) w;
}
return null;
}