### Question:
TesseraAppFactory { public static Optional<TesseraApp> create(CommunicationType communicationType, AppType appType) { LOGGER.info("Create from {} {}", communicationType, appType); return INSTANCE.createApp(communicationType, appType); } private  TesseraAppFactory(); static Optional<TesseraApp> create(CommunicationType communicationType, AppType appType);  }### Answer:
@Test public void createExisting() { Optional<TesseraApp> result = TesseraAppFactory.create(CommunicationType.REST, AppType.P2P); assertThat(result).isPresent(); assertThat(result.get()).isExactlyInstanceOf(MockTesseraApp.class); }
@Test public void createOtherExisting() { Optional<TesseraApp> result = TesseraAppFactory.create(CommunicationType.WEB_SOCKET, AppType.THIRD_PARTY); assertThat(result).isPresent(); assertThat(result.get()).isExactlyInstanceOf(OtherMockTesseraApp.class); }
@Test public void createNonExisting() { Optional<TesseraApp> result = TesseraAppFactory.create(CommunicationType.WEB_SOCKET, AppType.P2P); assertThat(result).isNotPresent(); }