### Question:
SepModelImpl implements SepModel { static String toInternalSubscriptionName(String subscriptionName) { if (subscriptionName.indexOf(INTERNAL_HYPHEN_REPLACEMENT, 0) != -1) { throw new IllegalArgumentException("Subscription name cannot contain character \\U1400"); } return subscriptionName.replace('-', INTERNAL_HYPHEN_REPLACEMENT); } SepModelImpl(ZooKeeperItf zk, Configuration hbaseConf); @Override void addSubscription(String name); @Override boolean addSubscriptionSilent(String name); @Override void removeSubscription(String name); @Override boolean removeSubscriptionSilent(String name); @Override boolean hasSubscription(String name); static final char INTERNAL_HYPHEN_REPLACEMENT; }### Answer:
@Test public void testToInternalSubscriptionName_NoSpecialCharacters() { assertEquals("subscription_name", SepModelImpl.toInternalSubscriptionName("subscription_name")); }
@Test public void testToInternalSubscriptionName_HyphenMapping() { assertEquals("subscription" + SepModelImpl.INTERNAL_HYPHEN_REPLACEMENT + "name", SepModelImpl.toInternalSubscriptionName("subscription-name")); }
@Test(expected=IllegalArgumentException.class) public void testToInternalSubscriptionName_NameContainsMappedHyphen() { SepModelImpl.toInternalSubscriptionName("subscription" + SepModelImpl.INTERNAL_HYPHEN_REPLACEMENT + "name"); }