### Question:
AppSchemaDataAccessRegistry extends DataAccessRegistry { public static FeatureTypeMapping getMappingByElement(Name featureTypeName) throws IOException { if (registry == null) { throw new UnsupportedOperationException("No registered data access found for: " + featureTypeName.toString()); } for (DataAccess<FeatureType, Feature> dataAccess : registry) { if (dataAccess instanceof AppSchemaDataAccess) { if (((AppSchemaDataAccess) dataAccess).hasElement(featureTypeName)) { return ((AppSchemaDataAccess) dataAccess).getMappingByElement(featureTypeName); } } } throwDataSourceException(featureTypeName); return null; }  static FeatureTypeMapping getMappingByName(Name featureTypeName); static FeatureTypeMapping getMappingByElement(Name featureTypeName); static FeatureSource<FeatureType, Feature> getSimpleFeatureSource(Name featureTypeName); static boolean hasName(Name featureTypeName); static boolean hasTargetElement(Name featureTypeName);  }### Answer:
@Test public void testThrowDataSourceException() throws Exception { Name typeName = Types.typeName(GSMLNS, "DoesNotExist"); boolean handledException = false; try { AppSchemaDataAccessRegistry.getMappingByElement(typeName); } catch (DataSourceException e) { LOGGER.info(e.toString()); handledException = true; assertTrue(e.getMessage().startsWith("Feature type " + typeName + " not found")); } assertTrue("Expected a DataSourceException to have been thrown and handled", handledException); }