package jetbrains.mps.asTest;
/*Generated by MPS */
import junit.framework.TestCase;
import junit.framework.Assert;
public class AsTest_Test extends TestCase {
public void test_as() throws Exception {
String str = "a string";
int i = 42;
Object o = new Object();
Assert.assertNull(as_q3h6h2_a0a3a0(str, Integer.class));
Assert.assertNotNull(as_q3h6h2_a0a4a0(i, Integer.class));
Assert.assertNull(as_q3h6h2_a0a5a0(o, String.class));
Assert.assertSame(str, as_q3h6h2_a1a6a0(str, String.class));
Assert.assertSame(str, as_q3h6h2_a1a7a0(str, Object.class));
}
public AsTest_Test() {
}
private static <T> T as_q3h6h2_a0a3a0(Object o, Class<T> type) {
return (type.isInstance(o) ? (T) o : null);
}
private static <T> T as_q3h6h2_a0a4a0(Object o, Class<T> type) {
return (type.isInstance(o) ? (T) o : null);
}
private static <T> T as_q3h6h2_a0a5a0(Object o, Class<T> type) {
return (type.isInstance(o) ? (T) o : null);
}
private static <T> T as_q3h6h2_a1a6a0(Object o, Class<T> type) {
return (type.isInstance(o) ? (T) o : null);
}
private static <T> T as_q3h6h2_a1a7a0(Object o, Class<T> type) {
return (type.isInstance(o) ? (T) o : null);
}
}