PduFactoryProvider { public static PduFactory get(PduVersion pduVersion) { if (!pduFactories.containsKey(pduVersion)) { throw new IllegalArgumentException("Invalid PDU version '" + pduVersion + "'. Allowed values are: " + PduVersion.V2); } return pduFactories.get(pduVersion); }  static PduFactory get(PduVersion pduVersion); static PduFactory withAggregatorConfListener(PduVersion pduVersion, ConfigurationListener<AggregatorConfiguration> aggregatorConfigurationListener); static PduFactory withExtenderConfListener(PduVersion pduVersion, ConfigurationListener<ExtenderConfiguration> extenderConfigurationListener);  }
@Test public void testGetPduFactoryProvider_OK(){ PduFactory factory = PduFactoryProvider.get(PduVersion.V2); Assert.assertNotNull(factory, "Returned factory is null."); }
@Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = "Invalid PDU version 'V1'. Allowed values are: V2") public void testGetPduFactoryProvider_DeprecatedInput(){ PduFactory factory = PduFactoryProvider.get(PduVersion.V1); }