### Question:
DataTypesAction implements Action<GetDataTypes, DataTypes> { @Override public DataTypes handle(GetDataTypes request) { Set<String> transferDataTypes = registry.getTransferDataTypes(); if (transferDataTypes.isEmpty()) { monitor.severe( () -> "No transfer data types were registered in " + AuthServiceProviderRegistry.class.getName()); } return new DataTypes(transferDataTypes); } @Inject  DataTypesAction(AuthServiceProviderRegistry registry, Monitor monitor); @Override Class<GetDataTypes> getRequestType(); @Override DataTypes handle(GetDataTypes request);  }### Answer:
@Test public void testHandle() { AuthServiceProviderRegistry registry = mock(AuthServiceProviderRegistry.class); Set<String> dataTypes = new HashSet<>(Arrays.asList("CONTACTS", "PHOTOS")); when(registry.getTransferDataTypes()).thenReturn(dataTypes); DataTypesAction dataTypesAction = new DataTypesAction(registry, new Monitor() {}); GetDataTypes request = mock(GetDataTypes.class); DataTypes actual = dataTypesAction.handle(request); Assert.assertEquals(actual.getDataTypes(), dataTypes); }