Many years ago politics was straight forward. MPs held beliefs and their actions were guided by these beliefs. In modern society however politicians have beliefs but are more than happy to change them whenever it is convenient to do so. This new type of politics needs sophisticated software to model it.
There are four different types of politician; Conservative MPs, Liberal Democrat MPs, Labour MPs and Green Party MPs. The “firmly held” beliefs of these politicians are very different.
Conservative MPs believe that “they know best”. Liberal Democrat MPs believe that “the public are daft”. Labour MPs believe that “everybody should have a job”. Green Party MPs believe that “recycling is fun”.
The politicians also differ in where they live. Conservative MPs live in “big detached houses”. Liberal Democrat MPs live in “cloud cuckoo land”. Labour MPs live in “modest houses”. Green Party MPs live “in trees”
Using the Strategy pattern develop the Java code to model the MPs and their behaviour.
You should develop a menu driven system that allows the user create MP objects of any type and to dynamically change the behaviour of what the MP believes and where they live. When the user creates an object they will enter the MPs first name and second name using the menu system. All MPs will have their default behaviour set when the object is created. The menu should also allow the user to print the details of each of the MPs i.e. what they believe and where they live.
The menu system will allow the user to create objects, view objects and change the behaviour of objects.
Your system should serialize the data when the user exits. When the system is started up you should load the serialized data.
In addition to your program you should provide a comprehensive JUnit test suite. This should test all of the methods on your main MP class and any subclasses of the MP class. You do not need to provide JUnit tests for your menu system nor for any of the behaviour classes which implement the behaviour interfaces