Source:
private SSLEngine getRawEngine(String host, int port) throws Exception { return new SSLEngine(host, port) { @Override public SSLEngineResult wrap(ByteBuffer[] byteBuffers, int i, int i1, ByteBuffer byteBuffer) throws SSLException { return null; } @Override public SSLEngineResult unwrap(ByteBuffer byteBuffer, ByteBuffer[] byteBuffers, int i, int i1) throws SSLException { return null; } @Override public Runnable getDelegatedTask() { return null; } @Override public void closeInbound() throws SSLException @Override public boolean isInboundDone() { return false; } @Override public void closeOutbound() @Override public boolean isOutboundDone() { return false; } @Override public String[] getSupportedCipherSuites() { return new String[0]; } @Override public String[] getEnabledCipherSuites() { return new String[0]; } @Override public void setEnabledCipherSuites(String[] strings) @Override public String[] getSupportedProtocols() { return new String[0]; } @Override public String[] getEnabledProtocols() { return new String[0]; } @Override public void setEnabledProtocols(String[] strings) @Override public SSLSession getSession() { return null; } @Override public void beginHandshake() throws SSLException @Override public HandshakeStatus getHandshakeStatus() { return null; } @Override public void setUseClientMode(boolean b) @Override public boolean getUseClientMode() { return false; } @Override public void setNeedClientAuth(boolean b) @Override public boolean getNeedClientAuth() { return false; } @Override public void setWantClientAuth(boolean b) @Override public boolean getWantClientAuth() { return false; } @Override public void setEnableSessionCreation(boolean b) @Override public boolean getEnableSessionCreation() { return false; } }; }

Target:
private static SSLEngine getRawEngine(String host, int port) throws Exception { return new SSLEngine(host, port) { @Override public SSLEngineResult wrap(ByteBuffer[] byteBuffers, int i, int i1, ByteBuffer byteBuffer) throws SSLException { return null; } @Override public SSLEngineResult unwrap(ByteBuffer byteBuffer, ByteBuffer[] byteBuffers, int i, int i1) throws SSLException { return null; } @Override public Runnable getDelegatedTask() { return null; } @Override public void closeInbound() throws SSLException @Override public boolean isInboundDone() { return false; } @Override public void closeOutbound() @Override public boolean isOutboundDone() { return false; } @Override public String[] getSupportedCipherSuites() { return new String[0]; } @Override public String[] getEnabledCipherSuites() { return new String[0]; } @Override public void setEnabledCipherSuites(String[] strings) @Override public String[] getSupportedProtocols() { return new String[0]; } @Override public String[] getEnabledProtocols() { return new String[0]; } @Override public void setEnabledProtocols(String[] strings) @Override public SSLSession getSession() { return null; } @Override public void beginHandshake() throws SSLException @Override public HandshakeStatus getHandshakeStatus() { return null; } @Override public void setUseClientMode(boolean b) @Override public boolean getUseClientMode() { return false; } @Override public void setNeedClientAuth(boolean b) @Override public boolean getNeedClientAuth() { return false; } @Override public void setWantClientAuth(boolean b) @Override public boolean getWantClientAuth() { return false; } @Override public void setEnableSessionCreation(boolean b) @Override public boolean getEnableSessionCreation() { return false; } }; }