### Question:
DisplayHelperFroyo extends DisplayHelperBase { @Override public int getDisplayAngle() { switch (getDefaultDisplay().getRotation()) { case Surface.ROTATION_0: return 0; case Surface.ROTATION_90: return 90; case Surface.ROTATION_180: return 180; case Surface.ROTATION_270: return 270; default: throw new IllegalStateException(); } } DisplayHelperFroyo(final Context context); @Override int getDisplayAngle();  }### Answer:
@Test public void testGetDisplayAngle() { final DisplayHelperFroyo helper = new DisplayHelperFroyo(Robolectric.application); mShadowDisplay.setRotation(Surface.ROTATION_0); assertEquals(helper.getDisplayAngle(), 0); mShadowDisplay.setRotation(Surface.ROTATION_90); assertEquals(helper.getDisplayAngle(), 90); mShadowDisplay.setRotation(Surface.ROTATION_180); assertEquals(helper.getDisplayAngle(), 180); mShadowDisplay.setRotation(Surface.ROTATION_270); assertEquals(helper.getDisplayAngle(), 270); }
@Test(expected = IllegalStateException.class) public void testGetDisplayAngleIllegalStateException() { mShadowDisplay.setRotation(-1); new DisplayHelperFroyo(Robolectric.application).getDisplayAngle(); }