Source implements Serializable { @Nonnull public static Source getDefault() { final String value = System.getProperty(PROP_DEFAULT_SOURCE, ""); final Source defaultSource = DEFAULT_MAP.get(value); if (defaultSource == null) { throw new IllegalArgumentException(String.format("Invalid value for %s: %s", PROP_DEFAULT_SOURCE, value)); } return defaultSource; } protected  Source(); @Nonnull static Source getDefault(); abstract Type getType(); @Nonnull
    static final Source PROCESSED_IMAGE; @Nonnull
    static final Source RAW_IMAGE; @Nonnull
    static final Source FULL_SIZE_PREVIEW; final static String PROP_DEFAULT_SOURCE; final static String DEFAULT_SOURCE_FULL_SIZE_PREVIEW; final static String DEFAULT_SOURCE_PROCESSED_IMAGE; final static String DEFAULT_SOURCE_RAW_IMAGE; }
@Test public void testGetDefault1() { assertEquals(Source.PROCESSED_IMAGE, Source.getDefault()); }
@Test public void testGetDefault2() { System.setProperty(Source.PROP_DEFAULT_SOURCE, Source.DEFAULT_SOURCE_PROCESSED_IMAGE); assertEquals(Source.PROCESSED_IMAGE, Source.getDefault()); }
@Test public void testGetDefault3() { System.setProperty(Source.PROP_DEFAULT_SOURCE, Source.DEFAULT_SOURCE_FULL_SIZE_PREVIEW); assertEquals(Source.FULL_SIZE_PREVIEW, Source.getDefault()); }
@Test public void testGetDefault4() { System.setProperty(Source.PROP_DEFAULT_SOURCE, Source.DEFAULT_SOURCE_RAW_IMAGE); assertEquals(Source.RAW_IMAGE, Source.getDefault()); }
@Test(expected=IllegalArgumentException.class) public void testGetDefault5() { System.setProperty(Source.PROP_DEFAULT_SOURCE, "foobar"); Source.getDefault(); }