18. オレオレDIでも無いより良い! プロダクションコード public class SharedPreferencesFactory { static SharedPreferencesFactory INSTANCE = new SharedPreferencesFactory(); public static SharedPreferencesFactory getInstance() { return INSTANCE; } public SharedPreferences newInstance(Context context, String name) { return context.getSharedPreferences(name, Context.MODE_PRIVATE); } } テスト用のダミー public class DummySharedPreferenc
![テストがあればなんとかなる〜効率化までの道程〜](https://cdn-ak-scissors.b.st-hatena.com/image/square/2fa7399326c9e9990e9db78870d924b3f827b9dc/height=288;version=1;width=512/https%3A%2F%2Fcdn.slidesharecdn.com%2Fss_thumbnails%2Fv4-150228014912-conversion-gate01-thumbnail.jpg%3Fwidth%3D640%26height%3D640%26fit%3Dbounds)