### Question:
BorderDrawable extends Drawable { public boolean isRounded() { return mBorderRadius != null && (mBorderRadius.get(BORDER_TOP_LEFT) != 0 || mBorderRadius.get(BORDER_TOP_RIGHT) != 0 || mBorderRadius.get(BORDER_BOTTOM_RIGHT) != 0 || mBorderRadius.get(BORDER_BOTTOM_LEFT) != 0); } BorderDrawable(); @Override void draw(@NonNull Canvas canvas); @Override void setAlpha(int alpha); @Override int getAlpha(); @Override void setColorFilter(ColorFilter cf); @Override int getOpacity(); @Override void getOutline(@NonNull Outline outline); void setBorderWidth(CSSShorthand.EDGE edge, float width); void setBorderRadius(CORNER position, float radius); @NonNull float[] getBorderRadius(RectF borderBox); @NonNull float[] getBorderInnerRadius(RectF borderBox); void setBorderColor(CSSShorthand.EDGE edge, int color); void setBorderStyle(CSSShorthand.EDGE edge, @NonNull String style); int getColor(); void setColor(int color); void setImage(Shader shader); boolean hasImage(); boolean isRounded(); @NonNull Path getContentPath(@NonNull RectF borderBox); static final int BORDER_TOP_LEFT_RADIUS; static final int BORDER_TOP_RIGHT_RADIUS; static final int BORDER_BOTTOM_RIGHT_RADIUS; static final int BORDER_BOTTOM_LEFT_RADIUS; static final int BORDER_RADIUS_ALL; }### Answer:
@Test public void testIsRounded(){ BorderDrawable none = new BorderDrawable(); assertThat(none.isRounded(), is(false)); BorderDrawable full = new BorderDrawable(); full.setBorderRadius(BorderDrawable.BORDER_RADIUS_ALL, 12); assertThat(full.isRounded(), is(true)); BorderDrawable noneAndPart = new BorderDrawable(); noneAndPart.setBorderRadius(BorderDrawable.BORDER_TOP_LEFT_RADIUS, 5); noneAndPart.setBorderRadius(BorderDrawable.BORDER_BOTTOM_RIGHT_RADIUS, 12); assertThat(noneAndPart.isRounded(), is(true)); BorderDrawable fullAndPart = new BorderDrawable(); fullAndPart.setBorderRadius(BorderDrawable.BORDER_RADIUS_ALL, 0); fullAndPart.setBorderRadius(BorderDrawable.BORDER_TOP_LEFT_RADIUS, 12); fullAndPart.setBorderRadius(BorderDrawable.BORDER_BOTTOM_RIGHT_RADIUS, 19); assertThat(fullAndPart.isRounded(), is(true)); BorderDrawable partAndFull = new BorderDrawable(); partAndFull.setBorderRadius(BorderDrawable.BORDER_TOP_LEFT_RADIUS, 12); partAndFull.setBorderRadius(BorderDrawable.BORDER_RADIUS_ALL, 0); assertThat(partAndFull.isRounded(), is(true)); BorderDrawable zeroAll = new BorderDrawable(); zeroAll.setBorderRadius(BorderDrawable.BORDER_RADIUS_ALL, 0); assertThat(zeroAll.isRounded(), is(false)); BorderDrawable zeroPart = new BorderDrawable(); zeroPart.setBorderRadius(BorderDrawable.BORDER_TOP_LEFT_RADIUS, 0); assertThat(zeroPart.isRounded(), is(false)); }