:operationName: method
:visibility: private

include::../why.adoc[]

=== Code examples

=== Noncompliant code example

[source,scala,diff-id=1,diff-type=noncompliant]
----
class Foo extends Serializable {
  private def unusedMethod(): Unit = {...} // Noncompliant
  private def writeObject(s: ObjectOutputStream): Unit = {...} // Compliant, relates to the serialization mechanism
  private def readObject(s: ObjectInputStream): Unit = {...} // Compliant, relates to the serialization mechanism
}
----

=== Compliant solution

[source,scala,diff-id=1,diff-type=compliant]
----
class Foo extends Serializable {
  private def writeObject(s: ObjectOutputStream): Unit = {...} // Compliant, relates to the serialization mechanism
  private def readObject(s: ObjectInputStream): Unit = {...} // Compliant, relates to the serialization mechanism
}
----

include::../exceptions-jvm.adoc[]

ifdef::env-github,rspecator-view[]

'''
== Implementation Specification
(visible only on this page)

include::../message.adoc[]

'''
== Comments And Links
(visible only on this page)

include::../comments-and-links.adoc[]

endif::env-github,rspecator-view[]
