implementation with Java