- Composition over inheritance
- Extract code to separate method instead of putting code comment
- Return early
- Don't ignore exception
- Avoid singleton pattern
- Provide private constructor only for utility classes
- Prefer non-static instead of static method for non-utility method
- Reuse ObjectMapper
- Prefer ObjectReader / ObjectWriter to ObjectMappaer
- Use StringBuilder instead of StringBuffer if no thread synchronization is needed
- Override Array / StringBuilder / StringBuffer's default capacity if the expected size is known
- Use constant.equals(variable) instead of variable.equals(constant) to prevent null checking
- Use Boolean.TRUE.equals(variable) instead of (variable != null && variable)
- Use switch on string instead of if-else-if-else block
- Use === / !== instead of == / !=
- Write log with correlation ID
- Group files by features
- Provide a common configuration and override configuration instead of duplicating the whole set of configuration
- Use Theories or Parameterized for multiple data tests