Here you can find the source of cast(Object x)
@SuppressWarnings("unchecked") public static <T> T cast(Object x)
//package com.java2s; public class Main { @SuppressWarnings("unchecked") public static <T> T cast(Object x) { return (T) x; }// w w w . j a v a2 s. c om }