### Question:
TransactionIdFactory { public static TransactionId createTransactionId(String transactionNumber, ChargingStationId chargingStationId, String protocol) { return Ints.tryParse(checkNotNull(transactionNumber)) != null ? new NumberedTransactionId(chargingStationId, protocol, Ints.tryParse(transactionNumber)) : new UuidTransactionId(UUID.fromString(transactionNumber)); } private  TransactionIdFactory(); static TransactionId createTransactionId(String transactionNumber, ChargingStationId chargingStationId, String protocol);  }### Answer:
@Test public void creationOfNumberedTransactionId() { TransactionId transactionId = TransactionIdFactory.createTransactionId("1234", CHARGING_STATION_ID, PROTOCOL); assertTrue(transactionId instanceof NumberedTransactionId); }
@Test public void creationOfUUIDTransactionId() { TransactionId transactionId = TransactionIdFactory.createTransactionId("123-456-789-000-000", CHARGING_STATION_ID, PROTOCOL); assertTrue(transactionId instanceof UuidTransactionId); }
@Test(expected = IllegalArgumentException.class) public void unsupportedTransactionId() { TransactionIdFactory.createTransactionId("%UnsupportedTransactionId%", CHARGING_STATION_ID, PROTOCOL); }
@Test(expected = NullPointerException.class) public void nullTransactionId() { TransactionIdFactory.createTransactionId(null, CHARGING_STATION_ID, PROTOCOL); }