class TextLayoutBuilder {

  public TextLayoutBuilder setAlignment(Alignment alignment) {
    if (mParams.alignment != alignment) {
      mParams.alignment = alignment;
      mSavedLayout = null;
    }
    return this;
  }

}

class TextLayoutBuilderTest {

  private static final String TEST;
  private static final String LONG_TEXT;
  private TextLayoutBuilder mBuilder;
  private Layout mLayout;

  @Test
  public void testSetAlignment() {

    mLayout = mBuilder.setAlignment(Layout.Alignment.ALIGN_CENTER).build();
    assertEquals(mBuilder.getAlignment(), Layout.Alignment.ALIGN_CENTER);
    assertEquals(mLayout.getAlignment(), Layout.Alignment.ALIGN_CENTER);
  }

}