BaseInfo implements java.io.Serializable { public void mock() { }  void mock(); static T mockObject(Class<T> clazz); static List<T> mockList(int max, Class<T> clazz);  }
@Test public void testMock() { MyBaseInfo info = BaseInfo.mockObject(MyBaseInfo.class); Assert.assertTrue(info.id.equals("1")); MyBaseListInfo listInfo = new MyBaseListInfo(); listInfo.mock(); Assert.assertTrue(listInfo.count >= 0); if (listInfo.count > 0) { Assert.assertNotNull(listInfo.list.get(0)); } }