### Question:
EventUtils { public static EventTable toEventTable(Table sourceTable) { if (sourceTable == null) { return null; } return new EventTable(FieldSchemaUtils.getFieldNames(sourceTable.getPartitionKeys()), LocationUtils.hasLocation(sourceTable) ? LocationUtils.locationAsUri(sourceTable) : null); } private  EventUtils(); static List<URI> toUris(List<Path> paths); static EventPartitions toEventPartitions(Table table, List<Partition> partitions); static EventTable toEventTable(Table sourceTable); static EventSourceCatalog toEventSourceCatalog(SourceCatalog sourceCatalog); static EventReplicaCatalog toEventReplicaCatalog(ReplicaCatalog replicaCatalog, Security security); static EventTableReplication toEventTableReplication(TableReplication tableReplication); static final String EVENT_ID_UNAVAILABLE; }### Answer:
@Test public void toNullEventTable() { assertThat(EventUtils.toEventTable(null), is(nullValue())); }
@Test public void toEventTable() { when(tableStorageDescriptor.getLocation()).thenReturn("location"); EventTable eventTable = EventUtils.toEventTable(table); assertThat(eventTable, is(not(nullValue()))); assertThat(eventTable.getPartitionKeys(), is(PARTITION_KEY_NAMES)); assertThat(eventTable.getLocation(), is(URI.create("location"))); }
@Test public void toEventTableWithNullLocation() { EventTable eventTable = EventUtils.toEventTable(table); assertThat(eventTable, is(not(nullValue()))); assertThat(eventTable.getPartitionKeys(), is(PARTITION_KEY_NAMES)); assertThat(eventTable.getLocation(), is(nullValue())); }