@SuppressWarnings("unchecked") public static <T>T assertInstance(Object object,Class<T> klass){
  assertTrue(klass.isInstance(object));
  return (T)object;
}

@ SuppressWarnings ( "unchecked" ) public static < T > T assertInstance ( Object object , Class < T > klass ) { assertTrue ( klass . isInstance ( object ) ) ; return ( T ) object ; }
asserts that given object an instance of given klass . returns casted object .
