### Question:
ChmodBuilder extends ChFSBaseBuilder<ChmodBuilder> implements Builder<Chmod> { public ChmodBuilder withPermissions(final String permissions) { this.permissions.set(permissions); return this; } ChmodBuilder(); ChmodBuilder withPermissions(final String permissions); Chmod build();  }### Answer:
@Test public void testWithPermissions() { final String permission = "-rwxrw-rw-"; final ChmodBuilder builder = new ChmodBuilder(); builder.withPermissions(permission); final Chmod chmod = builder.build(); assertEquals(permission, chmod.getPermissions()); }
@Test public void testWithPermissionsCalledTwiceThrows() { final String permission1 = "-rwxrw-rw-"; final String permission2 = "-rwxrw-r-"; final ChmodBuilder builder = new ChmodBuilder(); builder.withPermissions(permission1); expectedException.expect(IllegalStateException.class); builder.withPermissions(permission2); }