### Question:
FoodFactory { public static Food getFood(String type) { Food food = null; try { food = (Food) Class.forName("com.hks.factory." + type).newInstance(); } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (InstantiationException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } return food; }  static Food getFood(String type);  }### Answer:
@Test public void test(){ Food food = FoodFactory.getFood("Fish"); food.introduce(); }