OptimizationConfigPolicy extends Policy { @Override public Object getCorrectPolicyDataObject() { return policyAdapter.getPolicyData(); } OptimizationConfigPolicy();  OptimizationConfigPolicy(PolicyRestAdapter policyAdapter); @Override Map<String, String> savePolicies(); @Override boolean prepareToSave(); @Override Object getCorrectPolicyDataObject();  }
@Test public void testConstructor1() { thrown.expect(NullPointerException.class); OptimizationConfigPolicy policy = new OptimizationConfigPolicy(); policy.getCorrectPolicyDataObject(); fail("Expected an exception"); }
@Test public void testConstructor2() { PolicyRestAdapter policyAdapter = new PolicyRestAdapter(); OptimizationConfigPolicy policy = new OptimizationConfigPolicy(policyAdapter); assertNull(policy.getCorrectPolicyDataObject()); }