@Test public void testImmutable() { POP3StartTlsResponse response = new POP3StartTlsResponse(POP3Response.OK_RESPONSE); assertThat(response).isInstanceOf(StartTlsResponse.class); assertThat(response.immutable()).isInstanceOf(StartTlsResponse.class); }
@Override public Response immutable() { return new StartTlsResponse() { @Override public boolean isEndSession() { return POP3StartTlsResponse.this.isEndSession(); } @Override public String getRetCode() { return POP3StartTlsResponse.this.getRetCode(); } @Override public List<CharSequence> getLines() { return POP3StartTlsResponse.this.getLines(); } }; }
POP3StartTlsResponse extends POP3Response implements StartTlsResponse { @Override public Response immutable() { return new StartTlsResponse() { @Override public boolean isEndSession() { return POP3StartTlsResponse.this.isEndSession(); } @Override public String getRetCode() { return POP3StartTlsResponse.this.getRetCode(); } @Override public List<CharSequence> getLines() { return POP3StartTlsResponse.this.getLines(); } }; } }
POP3StartTlsResponse extends POP3Response implements StartTlsResponse { @Override public Response immutable() { return new StartTlsResponse() { @Override public boolean isEndSession() { return POP3StartTlsResponse.this.isEndSession(); } @Override public String getRetCode() { return POP3StartTlsResponse.this.getRetCode(); } @Override public List<CharSequence> getLines() { return POP3StartTlsResponse.this.getLines(); } }; } POP3StartTlsResponse(String code, CharSequence description);  POP3StartTlsResponse(String code); }
POP3StartTlsResponse extends POP3Response implements StartTlsResponse { @Override public Response immutable() { return new StartTlsResponse() { @Override public boolean isEndSession() { return POP3StartTlsResponse.this.isEndSession(); } @Override public String getRetCode() { return POP3StartTlsResponse.this.getRetCode(); } @Override public List<CharSequence> getLines() { return POP3StartTlsResponse.this.getLines(); } }; } POP3StartTlsResponse(String code, CharSequence description);  POP3StartTlsResponse(String code); @Override Response immutable(); }
POP3StartTlsResponse extends POP3Response implements StartTlsResponse { @Override public Response immutable() { return new StartTlsResponse() { @Override public boolean isEndSession() { return POP3StartTlsResponse.this.isEndSession(); } @Override public String getRetCode() { return POP3StartTlsResponse.this.getRetCode(); } @Override public List<CharSequence> getLines() { return POP3StartTlsResponse.this.getLines(); } }; } POP3StartTlsResponse(String code, CharSequence description);  POP3StartTlsResponse(String code); @Override Response immutable();  }