### Question:
DataSourceFactory { public synchronized static DataSource getDataSource(String systemPropertyPrefix) { DataSource dataSource = DATA_SOURCES.get(systemPropertyPrefix); if (dataSource == null) { Properties dataSourceProperties = PropertiesUtils.subProperties(System.getProperties(), systemPropertyPrefix); dataSource = newDataSource(dataSourceProperties); DATA_SOURCES.put(systemPropertyPrefix, dataSource); } return dataSource; } private  DataSourceFactory(); synchronized static DataSource getDataSource(String systemPropertyPrefix); static DataSource newDataSource(Properties properties);  }### Answer:
@Test public void returns_a_dataSource_creating_it_using_system_properties() { System.setProperty(SYSPROP_MYDS_URL, JDBC_URL); System.setProperty(SYSPROP_MYDS_DRIVER_CLASS_NAME, JDBC_DRIVER_CLASS_NAME); DataSource dataSource = DataSourceFactory.getDataSource(MYDS); assertNotNull(dataSource); DataSource dataSource2 = DataSourceFactory.getDataSource(MYDS); assertEquals(dataSource, dataSource2); }