Model find(final Object object, final Model model) { if (model.equals(object)) { return model; } for (final Model child : model.getChildren()) { final Model match = find(object, child); if (match != null) { return match; } } return null; }
public static boolean type(final Model model) { return (!model.isCollection() && !model.getChildren().isEmpty()); }