Downloading sources for maven and sbt project dependencies

Command-line options for downloading sources for dependencies in maven and sbt.

August 6, 2015

Using StringReader to iterate over a String

Iterate over a String character by character.

March 12, 2010

Creating singleton collections

Collections class provides static methods for immutable singleton collections (List, Map, Set).

March 4, 2010

Creating unmodifiable & synchronized collections

By default, the classes available in the Java Collections framework are read/write enabled & not thread safe. Sometimes the requirement is to have a read only i.e. unmodifiable collection. The Collections class available in the java.util package provides utility methods to create such collections. Note: Do not confuse this class with the Collection interface which is the root interface of the collection hierarchy. The objects returned by these methods are wrappers over the original collection object you supply to the method (Decorator design pattern)....

March 2, 2010

Implementing equals(), hashCode(), toString() & compareTo() using reflection

Apache Commons Lang simplifies method implementation (equals(), hashCode(), etc.) with reflection, albeit with slower performance compared to explicit field usage.

March 1, 2010