class DatabaseActions {

    public ListRepresentation getNodesWithLabel( String labelName, Map<String,Object> properties )
    {
        Iterator<Node> nodes;

        if ( properties.size() == 0 )
        {
            nodes = graphDb.findNodes( label( labelName ) );
        }
        else if ( properties.size() == 1 )
        {
            Map.Entry<String,Object> prop = Iterables.single( properties.entrySet() );
            nodes = graphDb.findNodes( label( labelName ), prop.getKey(), prop.getValue() );
        }
        else
        {
            throw new IllegalArgumentException( "Too many properties specified. Either specify one property to " +
                                                "filter by, or none at all." );
        }

        IterableWrapper<NodeRepresentation,Node> nodeRepresentations =
                new IterableWrapper<NodeRepresentation,Node>( asList( nodes ) )
                {
                    @Override
                    protected NodeRepresentation underlyingObjectToObject( Node node )
                    {
                        return new NodeRepresentation( node );
                    }
                };

        return new ListRepresentation( RepresentationType.NODE, nodeRepresentations );
    }

    public  DatabaseActions( GraphDatabaseAPI graphDatabaseAPI );

}