fork download
  1. import java.util.List;
  2.  
  3. class SO53797703 {
  4. public static void main(String[] args) {}
  5.  
  6. public interface Node<T, N extends Node<T, N>> {
  7. T getValue();
  8. List<N> getNeighbors();
  9. void addNodes(List<N> nodes);
  10. }
  11.  
  12. public interface TreeNode<T> extends Node<T, TreeNode<T>> {
  13. List<TreeNode<T>> getChildren();
  14. void addChildren(List<TreeNode<T>> treeNodes);
  15.  
  16. @Override
  17. default List<TreeNode<T>> getNeighbors() {
  18. return getChildren();
  19. }
  20.  
  21. @Override
  22. default void addNodes(List<TreeNode<T>> nodes) {
  23. addChildren(nodes);
  24. }
  25. }
  26. }
Success #stdin #stdout 0.05s 2184192KB
stdin
Standard input is empty
stdout
Standard output is empty