@@ -0,0 +1,833 @@
+package design_patterns.factory_design_pattern;%0Aimport design_patterns.factory_design_pattern.Person;%0Aimport design_patterns.factory_design_pattern.PersonFactory;%0A%0A/*%0A%09Class to test class PersonFactory (Factory Design Pattern)%0A*/%0A%0A%0Aclass TestPersonFactory%7B%0A%0A%0A%09// Tests PersonFactory%0A%0A%09public static void test()%7B%0A%0A%09%09Person p = null;%0A%0A%09%09String%5B%5D types = %7B%22faculty%22, %22director%22, %22student%22, %22manager%22%7D;%0A%0A%09%09// For all types%0A%09%09for(String type: types)%7B%0A%0A%09%09%09// Create person of specific type%0A%09%09%09p = PersonFactory.createPerson(type);%0A%0A%09%09%09// If p is not null, show p's name and access%0A%09%09%09if(p!=null)%7B%0A%09%09%09%09System.out.println(%22Name: %22+p.getName()+%22, Access: %22+p.getAccessType());%0A%09%09%09%7D%0A%09%09%09else%7B%0A%09%09%09%09// display error message%0A%09%09%09%09System.out.println(%22Unknown person type%22);%09%0A%09%09%09%7D%0A%0A%09%09%7D%0A%0A%09%7D%0A%0A%0A%09public static void main(String%5B%5D args)%7B%0A%0A%09%09%09test();%0A%09%7D%0A%0A%7D

Add test class for PersonFactory