### Question:
DebugSectionUtils { static DataSource unwrapSourceFromCacheDataSource(DataSource dataSource) { if (dataSource instanceof CacheDataSource) { try { Field source = CacheDataSource.class.getDeclaredField("source"); source.setAccessible(true); return (DataSource) source.get(dataSource); } catch (NoSuchFieldException | IllegalAccessException e) { ConsoleLogger.logException("Could not get source of CacheDataSource:", e); return null; } } return dataSource; } private  DebugSectionUtils();   }### Answer:
@Test public void shouldReturnSameDataSourceInstance() { DataSource dataSource = mock(DataSource.class); DataSource result = DebugSectionUtils.unwrapSourceFromCacheDataSource(dataSource); assertThat(result, equalTo(dataSource)); }
@Test public void shouldUnwrapCacheDataSource() { DataSource source = mock(DataSource.class); PlayerCache playerCache = mock(PlayerCache.class); CacheDataSource cacheDataSource = new CacheDataSource(source, playerCache); DataSource result = DebugSectionUtils.unwrapSourceFromCacheDataSource(cacheDataSource); assertThat(result, equalTo(source)); }