General data structures implement in java