Legofy { public static Legofy with(Context context) { if (context == null) { throw new RuntimeException("Context must not be null"); } return new Legofy(context.getApplicationContext()); } protected  Legofy(Context context, BitmapWrapper bitmapWrapper, BrickDrawer brickDrawer); private  Legofy(Context context); static Legofy with(Context context); Legofy amountOfBricks(int minimumBricks); Bitmap convert(Bitmap bitmap); int getBricksInWidth(); static final int MINIMUM_BRICKSIZE; static final int DEFAULT_AMOUNTOFBRICKS; static final int DEFAULT_MAXOUTPUTSIZE; static final int DEFAULT_SCALE; }
@Test public void createViaFactory() throws Exception { Legofy legofy = Legofy.with(mockContext); assertThat(legofy).isNotNull(); }
@Test(expected = RuntimeException.class) public void throwExceptionWhenContextNull() throws Exception { Legofy.with(null); }
@Test public void takeApplicationContext() throws Exception { Legofy.with(mockContext); verify(mockContext).getApplicationContext(); }