### Question:
ReplicationTask { public static ReplicationTask create(HCatClient client, HCatNotificationEvent event){ if (event == null){ throw new IllegalArgumentException("event should not be null"); } return getFactoryInstance(client).create(client,event); } protected  ReplicationTask(HCatNotificationEvent event); static void resetFactory(Class<? extends Factory> factoryClass); static ReplicationTask create(HCatClient client, HCatNotificationEvent event); HCatNotificationEvent getEvent(); abstract boolean needsStagingDirs(); boolean isActionable(); ReplicationTask withSrcStagingDirProvider(StagingDirectoryProvider srcStagingDirProvider); ReplicationTask withDstStagingDirProvider(StagingDirectoryProvider dstStagingDirProvider); ReplicationTask withTableNameMapping(Function<String,String> tableNameMapping); ReplicationTask withDbNameMapping(Function<String,String> dbNameMapping); abstract Iterable<? extends Command> getSrcWhCommands(); abstract Iterable<? extends Command> getDstWhCommands();  }### Answer:
@Test public void testCreate() throws HCatException { Table t = new Table(); t.setDbName("testdb"); t.setTableName("testtable"); NotificationEvent event = new NotificationEvent(0, (int)System.currentTimeMillis(), HCatConstants.HCAT_CREATE_TABLE_EVENT, msgFactory.buildCreateTableMessage(t).toString()); event.setDbName(t.getDbName()); event.setTableName(t.getTableName()); ReplicationTask.resetFactory(null); ReplicationTask rtask = ReplicationTask.create(HCatClient.create(new HiveConf()),new HCatNotificationEvent(event)); assertTrue("Provided factory instantiation should yield CreateTableReplicationTask", rtask instanceof CreateTableReplicationTask); ReplicationTask.resetFactory(NoopFactory.class); rtask = ReplicationTask.create(HCatClient.create(new HiveConf()),new HCatNotificationEvent(event)); assertTrue("Provided factory instantiation should yield NoopReplicationTask", rtask instanceof NoopReplicationTask); ReplicationTask.resetFactory(null); }